aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2024-02-04 23:27:43 +0100
committerJay Berkenbilt <ejb@ql.org>2024-02-04 23:27:49 +0100
commit7ae095fa091af9a94e0e9bf140280a0519859d98 (patch)
treeabccea9e1ed0f4ffa191ec43c9f47754b370a408 /libqpdf
parentf0fb19df9d31a550960fac12a6cc96432b885bba (diff)
downloadqpdf-7ae095fa091af9a94e0e9bf140280a0519859d98.tar.zst
Fix JSON parser error found by fuzz
Diffstat (limited to 'libqpdf')
-rw-r--r--libqpdf/JSON.cc3
1 files changed, 2 insertions, 1 deletions
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;
}