mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-04 05:20:30 +00:00
LibPDF: Reject non-hexdigits in hex string with error
...instead of VERIFY()ing input data. I haven't seen this in the wild, but since I'm here anyways, might as well fix this.
This commit is contained in:
parent
4675700057
commit
54cdcd0d06
Notes:
sideshowbarker
2024-07-16 21:34:08 +09:00
Author: https://github.com/nico Commit: https://github.com/SerenityOS/serenity/commit/54cdcd0d06 Pull-request: https://github.com/SerenityOS/serenity/pull/21585
1 changed files with 3 additions and 1 deletions
|
@ -380,7 +380,9 @@ PDFErrorOr<DeprecatedString> Parser::parse_hex_string()
|
|||
builder.append(static_cast<char>(hex_value));
|
||||
return builder.to_deprecated_string();
|
||||
}
|
||||
VERIFY(isxdigit(ch));
|
||||
|
||||
if (!isxdigit(ch))
|
||||
return error("character in hex string isn't hex digit");
|
||||
|
||||
hex_value *= 16;
|
||||
if (ch <= '9') {
|
||||
|
|
Loading…
Reference in a new issue