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

Commit9711fa0

Browse files
committed
Fix undersized result buffer in pset_quoted_string().
The malloc request was 1 byte too small for the worst-case output.This seems relatively unlikely to cause any problems in practice,as the worst case only occurs if the input string contains nocharacters other than single-quote or newline, and even thenmalloc alignment padding would probably save the day. But it'sdefinitely a bug.David Rowley
1 parenta4523c5 commit9711fa0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎src/bin/psql/command.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2711,7 +2711,7 @@ pset_bool_string(bool val)
27112711
staticchar*
27122712
pset_quoted_string(constchar*str)
27132713
{
2714-
char*ret=pg_malloc(strlen(str)*2+2);
2714+
char*ret=pg_malloc(strlen(str)*2+3);
27152715
char*r=ret;
27162716

27172717
*r++='\'';

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp