aboutsummaryrefslogtreecommitdiffstats
path: root/libtests
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2024-02-06 21:30:29 +0100
committerJay Berkenbilt <ejb@ql.org>2024-02-06 21:30:29 +0100
commitb1b789df4203296a848fec6a3513f30efceb1a45 (patch)
treee1a506f8a74be0f502b05ce0f17c1816d162c129 /libtests
parent3490090fbc7266dfcf7c80c6766d4d557b314292 (diff)
downloadqpdf-b1b789df4203296a848fec6a3513f30efceb1a45.tar.zst
Detect end of input inside an unfinished JSON string
Diffstat (limited to 'libtests')
-rw-r--r--libtests/json.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/libtests/json.cc b/libtests/json.cc
index e84ef0a0..4f4cff8e 100644
--- a/libtests/json.cc
+++ b/libtests/json.cc
@@ -134,6 +134,12 @@ test_main()
" \"normal\": \"string\"\n"
"}");
+ try {
+ JSON::parse("\"");
+ assert(false);
+ } catch (std::runtime_error&) {
+ }
+
// Check default constructed JSON object (order as per JSON.hh).
JSON uninitialized;
std::string ws;