LibPDF: Added empty read check to parse_hex_string

This commit is contained in:
Ava Rider 2024-05-05 13:26:34 +12:00 committed by Sam Atkins
commit 3a7bea7402
Notes: sideshowbarker 2024-07-16 21:42:29 +09:00

View file

@ -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