mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-12 12:32:21 +00:00
LibPDF: Added empty read check to parse_hex_string
This commit is contained in:
parent
8ff16c1b57
commit
3a7bea7402
Notes:
sideshowbarker
2024-07-16 21:42:29 +09:00
Author: https://github.com/sSt3lla
Commit: 3a7bea7402
Pull-request: https://github.com/SerenityOS/serenity/pull/24217
Reviewed-by: https://github.com/nico ✅
1 changed files with 4 additions and 0 deletions
|
@ -362,6 +362,10 @@ PDFErrorOr<ByteString> Parser::parse_hex_string()
|
|||
|
||||
for (int i = 0; i < 2; i++) {
|
||||
m_reader.consume_whitespace();
|
||||
|
||||
if (m_reader.done())
|
||||
return error("unterminated hex string");
|
||||
|
||||
auto ch = m_reader.consume();
|
||||
if (ch == '>') {
|
||||
// The hex string contains an odd number of characters, and the last character
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue