From 7ae095fa091af9a94e0e9bf140280a0519859d98 Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Sun, 4 Feb 2024 17:27:43 -0500 Subject: Fix JSON parser error found by fuzz --- libqpdf/JSON.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libqpdf') diff --git a/libqpdf/JSON.cc b/libqpdf/JSON.cc index c9816809..28f451a9 100644 --- a/libqpdf/JSON.cc +++ b/libqpdf/JSON.cc @@ -1246,7 +1246,8 @@ JSONParser::handleToken() break; default: - throw std::logic_error("JSONParser::handleToken : non-terminal lexer state encountered"); + throw std::runtime_error( + "JSON: offset " + std::to_string(offset) + ": premature end of input"); break; } -- cgit v1.2.3-54-g00ecf