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

Commite930c87

Browse files
Use safe string copy routine
Using memcpy with strlen as the size parameter will not take theNULL terminator into account, relying instead on the destinationbuffer being properly initialized. Replace with strlcpy which isa safer alternative, and more in line with how we handle copyingstrings elsewhere.Author: Ranier Vilela <ranier.vf@gmail.com>Discussion:https://postgr.es/m/CAEudQApAsbLsQ+gGiw-hT+JwGhgogFa_=5NUkgFO6kOPxyNidQ@mail.gmail.com
1 parentda3ea04 commite930c87

File tree

1 file changed

+1
-1
lines changed
  • src/backend/access/transam

1 file changed

+1
-1
lines changed

‎src/backend/access/transam/xlog.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8744,7 +8744,7 @@ do_pg_backup_start(const char *backupidstr, bool fast, List **tablespaces,
87448744
errmsg("backup label too long (max %d bytes)",
87458745
MAXPGPATH)));
87468746

8747-
memcpy(state->name,backupidstr,strlen(backupidstr));
8747+
strlcpy(state->name,backupidstr,sizeof(state->name));
87488748

87498749
/*
87508750
* Mark backup active in shared memory. We must do full-page WAL writes

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp