diff --git a/backport-fix-issue-854-Set-error-json_tokener_error_memory-in.patch b/backport-fix-issue-854-Set-error-json_tokener_error_memory-in.patch new file mode 100644 index 0000000..925d6a9 --- /dev/null +++ b/backport-fix-issue-854-Set-error-json_tokener_error_memory-in.patch @@ -0,0 +1,28 @@ +From e93ae70417867dac9ff87614f3e7bc50e79ef951 Mon Sep 17 00:00:00 2001 +From: Eric Hawicz +Date: Fri, 29 Mar 2024 18:09:12 -0400 +Subject: [PATCH 093/100] Fix issue #854: Set error=json_tokener_error_memory + in json_tokener_parser_verbose() when allocating the tokener fails. + +--- + json_tokener.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/json_tokener.c b/json_tokener.c +index 9926563..e8244a3 100644 +--- a/json_tokener.c ++++ b/json_tokener.c +@@ -226,7 +226,10 @@ struct json_object *json_tokener_parse_verbose(const char *str, enum json_tokene + + tok = json_tokener_new(); + if (!tok) ++ { ++ *error = json_tokener_error_memory; + return NULL; ++ } + obj = json_tokener_parse_ex(tok, str, -1); + *error = tok->err; + if (tok->err != json_tokener_success +-- +2.33.0 + diff --git a/json-c.spec b/json-c.spec index a48a686..2468912 100644 --- a/json-c.spec +++ b/json-c.spec @@ -6,7 +6,7 @@ Name: json-c Version: 0.17 -Release: 1 +Release: 2 Summary: JSON implementation in C License: MIT @@ -15,6 +15,8 @@ Source0: %{url}/archive/%{name}-%{version}-%{reldate}.tar.gz BuildRequires: cmake gcc ninja-build +Patch001: backport-fix-issue-854-Set-error-json_tokener_error_memory-in.patch + %description JSON-C implements a reference counting object model that allows you to easily construct JSON objects in C, output them as JSON formatted @@ -101,6 +103,9 @@ end %doc %{_pkgdocdir} %changelog +* Thu May 16 2024 xiaozai - 0.17-2 +- add backport-fix-issue-854-Set-error-json_tokener_error_memory-in.patch + * Wed Aug 16 2023 dillon chen - 0.17-1 - Update to 0.17