aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2022-02-25 17:42:50 +0100
committerJay Berkenbilt <ejb@ql.org>2022-02-25 17:42:50 +0100
commit36794a60cf2a9739d4e1b021c9ba00feef9d42da (patch)
tree13d7718a46e4d4fd0a0bb419974fcb8502fd1b22 /libqpdf
parente7ecc348f9c48af9a04a5426ca30b9f414ba12d9 (diff)
downloadqpdf-36794a60cf2a9739d4e1b021c9ba00feef9d42da.tar.zst
Allow \/ in a json string
Diffstat (limited to 'libqpdf')
-rw-r--r--libqpdf/JSON.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/libqpdf/JSON.cc b/libqpdf/JSON.cc
index 4def376e..3f96ab5d 100644
--- a/libqpdf/JSON.cc
+++ b/libqpdf/JSON.cc
@@ -629,6 +629,9 @@ JSONParser::decode_string(std::string const& str)
{
case '\\':
case '\"':
+ case '/':
+ // \/ is allowed in json input, but so is /, so we
+ // don't map / to \/ in output.
result.append(1, ch);
break;
case 'b':
@@ -875,7 +878,7 @@ void JSONParser::getToken()
case ls_backslash:
/* cSpell: ignore bfnrt */
- if (strchr("\\\"bfnrt", *p))
+ if (strchr("\\\"/bfnrt", *p))
{
lex_state = ls_string;
}