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

Commit8e053dc

Browse files
committed
Fix possible NULL-pointer-deference in backup_compression.c.
Per Coverity and Tom Lane. Reviewed by Tom Lane and Justin Pryzby.Discussion:http://postgr.es/m/384291.1648403267@sss.pgh.pa.us
1 parent027fa0f commit8e053dc

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

‎src/common/backup_compression.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,16 @@ parse_bc_specification(bc_algorithm algorithm, char *specification,
191191
if (value!=NULL)
192192
pfree(value);
193193

194-
/* If we got an error or have reached the end of the string, stop. */
195-
if (result->parse_error!=NULL||*kwend=='\0'||*vend=='\0')
194+
/*
195+
* If we got an error or have reached the end of the string, stop.
196+
*
197+
* If there is no value, then the end of the keyword might have been
198+
* the end of the string. If there is a value, then the end of the
199+
* keyword cannot have been the end of the string, but the end of the
200+
* value might have been.
201+
*/
202+
if (result->parse_error!=NULL||
203+
(vend==NULL ?*kwend=='\0' :*vend=='\0'))
196204
break;
197205

198206
/* Advance to next entry and loop around. */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp