Skip to content

Fixes in libcef_dll: possible null dereference in ParseCommandLineArgs() and missed low surrogate is not handled in UTF16ToUTF8()#4219

Open
sergio-nsk wants to merge 3 commits into
chromiumembedded:masterfrom
sergio-nsk:sergio-nsk/fixes/1
Open

Fixes in libcef_dll: possible null dereference in ParseCommandLineArgs() and missed low surrogate is not handled in UTF16ToUTF8()#4219
sergio-nsk wants to merge 3 commits into
chromiumembedded:masterfrom
sergio-nsk:sergio-nsk/fixes/1

Conversation

@sergio-nsk

Copy link
Copy Markdown
Contributor

No description provided.

Comment thread tests/ceftests/string_unittest.cc Outdated

// 3-byte UTF-8 standard fallback replacement characters.
// Lone low surrogate DE00.
EXPECT_EQ("\xEF\xBF\xBDcef", UTF16ToUTF8(u"\uDE00cef"));

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

\x escapes consume every following hexadecimal digit, so the c, e, and f suffix here is parsed as part of the final escape (\xBDcef). Clang rejects this with hex escape sequence out of range, which prevents ceftests from compiling. Please terminate the escape with an adjacent literal: "\xEF\xBF\xBD" "cef".

@sergio-nsk sergio-nsk Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ha, I missed that what is done on the previous line. If you don't mind I make it "\xEF\xBF\xBDz" otherwise it gets an ugly format

  EXPECT_EQ(
      "\xEF\xBF\xBD"
      "cef",
      UTF16ToUTF8(u"\uDE00"
                  u"cef"));

@sergio-nsk
sergio-nsk force-pushed the sergio-nsk/fixes/1 branch from 103a3a6 to 1e26ba4 Compare July 22, 2026 01:57
@sergio-nsk sergio-nsk changed the title Fixes in libcef_dll: possible null dereference ParseCommandLineArgs() and missed low surrogate is not handled in UTF16ToUTF8() Fixes in libcef_dll: possible null dereference in ParseCommandLineArgs() and missed low surrogate is not handled in UTF16ToUTF8() Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants