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

Commitd1fcc62

Browse files
committed
Fix incorrect buffer-length argument to uloc_getDisplayName().
The maxResultSize argument of uloc_getDisplayName is the number ofUChars in the output buffer, not the number of bytes. In principlethis could result in a stack smash, although at least in my Fedora 25install there are no ICU locales with display names long enough tooverrun the buffer. But it's easily proven to be wrong by reducingthe length of displayname to around 20, whereupon a stack smashdoes happen.(This is a rather scary bug, because the same mistake could easilyhave been made in other places; but in a quick code search lookingat uses of UChar I could not find any other instances.)
1 parent08859bb commitd1fcc62

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎src/backend/commands/collationcmds.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ get_icu_locale_comment(const char *localename)
443443

444444
status=U_ZERO_ERROR;
445445
len_uchar=uloc_getDisplayName(localename,"en",
446-
&displayname[0],sizeof(displayname),
446+
displayname,lengthof(displayname),
447447
&status);
448448
if (U_FAILURE(status))
449449
ereport(ERROR,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp