Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite66fcce

Browse files
author
Neil Conway
committed
Use memmove() rather than memcpy() in set_var_from_var(). If this function
is asked to assign a variable to itself, it will result in doing amemcpy() on an entirely-overlapping memory range, which results inundefined behavior according to ANSI C. That said, it is unlikely toactually do anything bad on any sane libc, but this keeps valgrind quiet.
1 parentd391718 commite66fcce

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎src/backend/utils/adt/numeric.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* Copyright (c) 1998-2003, PostgreSQL Global Development Group
1515
*
1616
* IDENTIFICATION
17-
* $PostgreSQL: pgsql/src/backend/utils/adt/numeric.c,v 1.70 2003/12/02 00:26:59 tgl Exp $
17+
* $PostgreSQL: pgsql/src/backend/utils/adt/numeric.c,v 1.71 2004/02/04 01:11:47 neilc Exp $
1818
*
1919
*-------------------------------------------------------------------------
2020
*/
@@ -2729,7 +2729,7 @@ set_var_from_var(NumericVar *value, NumericVar *dest)
27292729

27302730
digitbuf_free(dest->buf);
27312731

2732-
memcpy(dest,value,sizeof(NumericVar));
2732+
memmove(dest,value,sizeof(NumericVar));
27332733
dest->buf=newbuf;
27342734
dest->digits=newbuf+1;
27352735
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp