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

Commitf11aa82

Browse files
committed
Use memcpy() instead of strncpy() for copying into varlena structures.
1 parent4f64a07 commitf11aa82

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

‎contrib/intarray/_int_bool.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,7 @@ querytree(PG_FUNCTION_ARGS)
779779

780780
res= (text*)palloc(nrm.cur-nrm.buf+VARHDRSZ);
781781
VARATT_SIZEP(res)=nrm.cur-nrm.buf+VARHDRSZ;
782-
strncpy(VARDATA(res),nrm.buf,nrm.cur-nrm.buf);
782+
memcpy(VARDATA(res),nrm.buf,nrm.cur-nrm.buf);
783783
}
784784
pfree(q);
785785

‎contrib/tsearch2/query.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -928,7 +928,7 @@ tsquerytree(PG_FUNCTION_ARGS)
928928

929929
res= (text*)palloc(nrm.cur-nrm.buf+VARHDRSZ);
930930
VARATT_SIZEP(res)=nrm.cur-nrm.buf+VARHDRSZ;
931-
strncpy(VARDATA(res),nrm.buf,nrm.cur-nrm.buf);
931+
memcpy(VARDATA(res),nrm.buf,nrm.cur-nrm.buf);
932932
pfree(q);
933933
}
934934

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp