summaryrefslogtreecommitdiffstats
path: root/libtests
diff options
context:
space:
mode:
authorm-holger <m-holger@kubitscheck.org>2023-01-29 12:39:15 +0100
committerm-holger <m-holger@kubitscheck.org>2023-02-04 15:55:49 +0100
commit5ac6a12e0a76613d29edc65beb6b99af45172493 (patch)
treebe3b45e33c5603f32e004d2d412a7be95016b434 /libtests
parent1b89e7684edc7af2ad4ae998bba41b40f8780c3f (diff)
downloadqpdf-5ac6a12e0a76613d29edc65beb6b99af45172493.tar.zst
In JSONParser::getToken reject illegal control characters
Diffstat (limited to 'libtests')
-rw-r--r--libtests/qtest/json_parse.test4
-rw-r--r--libtests/qtest/json_parse/bad-18.out2
-rw-r--r--libtests/qtest/json_parse/bad-45.json1
-rw-r--r--libtests/qtest/json_parse/bad-45.out1
-rw-r--r--libtests/qtest/json_parse/bad-46.json1
-rw-r--r--libtests/qtest/json_parse/bad-46.out1
-rw-r--r--libtests/qtest/json_parse/bad-47.json2
-rw-r--r--libtests/qtest/json_parse/bad-47.out1
-rw-r--r--libtests/qtest/json_parse/bad-48.json1
-rw-r--r--libtests/qtest/json_parse/bad-48.out1
10 files changed, 14 insertions, 1 deletions
diff --git a/libtests/qtest/json_parse.test b/libtests/qtest/json_parse.test
index d38d70de..8234b755 100644
--- a/libtests/qtest/json_parse.test
+++ b/libtests/qtest/json_parse.test
@@ -125,6 +125,10 @@ my @bad = (
"e after minus", # 42
"missing digit after e", # 43
"missing digit after e+/-", # 44
+ # "tab char in string", # 45
+ # "cr char in string", # 46
+ # "lf char in string", # 47
+ # "bs char in string", # 48
);
my $i = 0;
diff --git a/libtests/qtest/json_parse/bad-18.out b/libtests/qtest/json_parse/bad-18.out
index 0428b64f..1e779e41 100644
--- a/libtests/qtest/json_parse/bad-18.out
+++ b/libtests/qtest/json_parse/bad-18.out
@@ -1 +1 @@
-exception: bad-18.json: JSON: null character at offset 5
+exception: bad-18.json: JSON: control or null character at offset 5
diff --git a/libtests/qtest/json_parse/bad-45.json b/libtests/qtest/json_parse/bad-45.json
new file mode 100644
index 00000000..16107dc0
--- /dev/null
+++ b/libtests/qtest/json_parse/bad-45.json
@@ -0,0 +1 @@
+"Tab in str ing"
diff --git a/libtests/qtest/json_parse/bad-45.out b/libtests/qtest/json_parse/bad-45.out
new file mode 100644
index 00000000..ba7e4f16
--- /dev/null
+++ b/libtests/qtest/json_parse/bad-45.out
@@ -0,0 +1 @@
+"Tab in str\ting"
diff --git a/libtests/qtest/json_parse/bad-46.json b/libtests/qtest/json_parse/bad-46.json
new file mode 100644
index 00000000..60873bf4
--- /dev/null
+++ b/libtests/qtest/json_parse/bad-46.json
@@ -0,0 +1 @@
+"cr in str ing"
diff --git a/libtests/qtest/json_parse/bad-46.out b/libtests/qtest/json_parse/bad-46.out
new file mode 100644
index 00000000..2baad6a4
--- /dev/null
+++ b/libtests/qtest/json_parse/bad-46.out
@@ -0,0 +1 @@
+"cr in str\ring"
diff --git a/libtests/qtest/json_parse/bad-47.json b/libtests/qtest/json_parse/bad-47.json
new file mode 100644
index 00000000..3c75427a
--- /dev/null
+++ b/libtests/qtest/json_parse/bad-47.json
@@ -0,0 +1,2 @@
+"lf in str
+ing"
diff --git a/libtests/qtest/json_parse/bad-47.out b/libtests/qtest/json_parse/bad-47.out
new file mode 100644
index 00000000..30549072
--- /dev/null
+++ b/libtests/qtest/json_parse/bad-47.out
@@ -0,0 +1 @@
+"lf in str\ning"
diff --git a/libtests/qtest/json_parse/bad-48.json b/libtests/qtest/json_parse/bad-48.json
new file mode 100644
index 00000000..1e605808
--- /dev/null
+++ b/libtests/qtest/json_parse/bad-48.json
@@ -0,0 +1 @@
+"bs in string" \ No newline at end of file
diff --git a/libtests/qtest/json_parse/bad-48.out b/libtests/qtest/json_parse/bad-48.out
new file mode 100644
index 00000000..0b20fc7a
--- /dev/null
+++ b/libtests/qtest/json_parse/bad-48.out
@@ -0,0 +1 @@
+exception: bad-48.json: JSON: control or null character at offset 10