diff --git a/CMakeLists.txt b/CMakeLists.txt index 0c46067e5..596da0178 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -212,8 +212,8 @@ set_package_properties(ZSTD PROPERTIES TYPE REQUIRED ) -# v2.0+ required for json_loads() with three arguments -find_package(Jansson 2.0) +# v2.6+ required for JSON_ALLOW_NUL +find_package(Jansson 2.6) set_package_properties(Jansson PROPERTIES PURPOSE "Required for JSON support" DESCRIPTION "C library for encoding, decoding and manipulating JSON data" diff --git a/src/core/tools/qjsondocument.cpp b/src/core/tools/qjsondocument.cpp index 49c4286eb..25466be37 100644 --- a/src/core/tools/qjsondocument.cpp +++ b/src/core/tools/qjsondocument.cpp @@ -51,7 +51,7 @@ QVariantMap QJsonDocumentPrivate::jsonToMap(const QByteArray &jsondata) } json_error_t jerror; - json_t *jroot = json_loads(jsondata.constData(), 0, &jerror); + json_t *jroot = json_loads(jsondata.constData(), JSON_ALLOW_NUL, &jerror); if (!jroot) { error = jerror.text;