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

Commita8ae123

Browse files
committed
Fix detection of unfinished Unicode surrogate pair at end of string.
The U&'...' and U&"..." syntaxes silently discarded a surrogate pairstart (that is, a code between U+D800 and U+DBFF) if it occurred atthe very end of the string. This seems like an obvious oversight,since we throw an error for every other invalid combination of surrogatecharacters, including the very same situation in E'...' syntax.This has been wrong since the pair processing was added (in 9.0),so back-patch to all supported branches.Discussion:https://postgr.es/m/19113.1482337898@sss.pgh.pa.us
1 parent89fcea1 commita8ae123

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

‎src/backend/parser/scan.l

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1435,6 +1435,13 @@ litbuf_udeescape(unsigned char escape, core_yyscan_t yyscanner)
14351435
}
14361436
}
14371437

1438+
/* unfinished surrogate pair? */
1439+
if (pair_first)
1440+
{
1441+
ADVANCE_YYLLOC(in - litbuf +3);/* 3 for U&" */
1442+
yyerror("invalid Unicode surrogate pair");
1443+
}
1444+
14381445
*out ='\0';
14391446

14401447
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp