diff --git a/backport-Fix-the-apps-json_parse-s-strict-option-so-it-actual.patch b/backport-Fix-the-apps-json_parse-s-strict-option-so-it-actual.patch new file mode 100644 index 0000000000000000000000000000000000000000..1a5cd0e1e443b0b0daa29b1e95bb9897a95a041a --- /dev/null +++ b/backport-Fix-the-apps-json_parse-s-strict-option-so-it-actual.patch @@ -0,0 +1,37 @@ +From 474ee12435e671607c02f764b173258e3a059eda Mon Sep 17 00:00:00 2001 +From: Eric Hawicz +Date: Sun, 3 Nov 2024 19:44:21 -0500 +Subject: [PATCH] Fix the apps/json_parse "-s" (strict) option so it actually + does something, and default to non-strict. + +--- + apps/json_parse.c | 13 ++++++++----- + 1 file changed, 8 insertions(+), 5 deletions(-) + +diff --git a/apps/json_parse.c b/apps/json_parse.c +index 31221d0..4eb629b 100644 +--- a/apps/json_parse.c ++++ b/apps/json_parse.c +@@ -74,11 +74,14 @@ static int parseit(int fd, int (*callback)(struct json_object *)) + fprintf(stderr, "unable to allocate json_tokener: %s\n", strerror(errno)); + return 1; + } +- json_tokener_set_flags(tok, JSON_TOKENER_STRICT +-#ifdef JSON_TOKENER_ALLOW_TRAILING_CHARS +- | JSON_TOKENER_ALLOW_TRAILING_CHARS +-#endif +- ); ++ if (strict_mode) ++ { ++ json_tokener_set_flags(tok, JSON_TOKENER_STRICT ++ #ifdef JSON_TOKENER_ALLOW_TRAILING_CHARS ++ | JSON_TOKENER_ALLOW_TRAILING_CHARS ++ #endif ++ ); ++ } + + // XXX push this into some kind of json_tokener_parse_fd API? + // json_object_from_fd isn't flexible enough, and mirroring +-- +2.33.0 + diff --git a/json-c.spec b/json-c.spec index 15c37dbd43e26370bcdf582eb2e316d0b8732e73..dbb4f0641d135eab1db0d8b4d2b04c3c4a6ef4b4 100644 --- a/json-c.spec +++ b/json-c.spec @@ -4,7 +4,7 @@ Name: json-c Version: 0.18 -Release: 3 +Release: 4 Summary: JSON implementation in C License: MIT @@ -14,6 +14,7 @@ Source0: %{url}/archive/%{name}-%{version}-%{reldate}.tar.gz BuildRequires: cmake gcc ninja-build Patch6001: backport-Fix-issue-875-cast-to-unsigned-char-so-bytes-above-0.patch +Patch6002: backport-Fix-the-apps-json_parse-s-strict-option-so-it-actual.patch %description JSON-C implements a reference counting object model that allows you @@ -99,8 +100,17 @@ end %doc %{_pkgdocdir} %changelog +* Fri Dec 06 2024 sunhai - 0.18-4 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC: Fix the apps/json_parse "-s" (strict) option so it actually does something, and default to non-strict. + * Wed Dec 04 2024 yueyuankun - 0.18-3 -- Fix causing the strict-mode control characters check to incorrectly trigger +- Type:bugfix +- ID:NA +- SUG:NA +- DESC: Fix causing the strict-mode control characters check to incorrectly trigger * Mon Nov 11 2024 Funda Wang - 0.18-2 - adopt to new cmake macro