diff options
author | Jay Berkenbilt <ejb@ql.org> | 2024-02-06 21:30:29 +0100 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2024-02-06 21:30:29 +0100 |
commit | b1b789df4203296a848fec6a3513f30efceb1a45 (patch) | |
tree | e1a506f8a74be0f502b05ce0f17c1816d162c129 /libtests | |
parent | 3490090fbc7266dfcf7c80c6766d4d557b314292 (diff) | |
download | qpdf-b1b789df4203296a848fec6a3513f30efceb1a45.tar.zst |
Detect end of input inside an unfinished JSON string
Diffstat (limited to 'libtests')
-rw-r--r-- | libtests/json.cc | 6 |
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; |