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

Commitceee108

Browse files
committed
Fix psql crash while parsing SQL file whose encoding is different from
client encoding and the client encoding is not *safe* one. Such anexample is, file encoding is UTF-8 and client encoding SJIS. Patchcontributed by Jiang Guiqing.
1 parentdbf2e26 commitceee108

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎src/bin/psql/psqlscan.l

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1806,7 +1806,7 @@ prepare_buffer(const char *txt, int len, char **txtcopy)
18061806
/* first byte should always be okay... */
18071807
newtxt[i] = txt[i];
18081808
i++;
1809-
while (--thislen >0)
1809+
while (--thislen >0 && i < len)
18101810
newtxt[i++] = (char)0xFF;
18111811
}
18121812
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp