diff --git a/backport-Handle-yet-another-out-of-memory-condition.patch b/backport-Handle-yet-another-out-of-memory-condition.patch deleted file mode 100644 index c32bff311cffcc1e6536d163c71f74f2474e4084..0000000000000000000000000000000000000000 --- a/backport-Handle-yet-another-out-of-memory-condition.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 833233faa8d6835276ebbd48b92c7feeb141270d Mon Sep 17 00:00:00 2001 -From: Bruno Haible -Date: Mon, 22 Apr 2024 01:50:59 +0200 -Subject: [PATCH] Handle yet another out-of-memory condition. - -duplocale() can return NULL, with errno set to ENOMEM. -In this case, bail out and set the current error code to -json_tokener_error_memory. ---- - json_tokener.c | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/json_tokener.c b/json_tokener.c -index cc35527..0a86d82 100644 ---- a/json_tokener.c -+++ b/json_tokener.c -@@ -341,6 +341,11 @@ struct json_object *json_tokener_parse_ex(struct json_tokener *tok, const char * - #ifdef HAVE_USELOCALE - { - locale_t duploc = duplocale(oldlocale); -+ if (duploc == NULL && errno == ENOMEM) -+ { -+ tok->err = json_tokener_error_memory; -+ return NULL; -+ } - newloc = newlocale(LC_NUMERIC_MASK, "C", duploc); - if (newloc == NULL) - { --- -2.43.4 - diff --git a/backport-Issue-857-fix-a-few-places-where-json_tokener-should.patch b/backport-Issue-857-fix-a-few-places-where-json_tokener-should.patch deleted file mode 100644 index 0356d95b418f282533bb9056b58769aed22ccd34..0000000000000000000000000000000000000000 --- a/backport-Issue-857-fix-a-few-places-where-json_tokener-should.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 31a22fb2dabae30a759ae3346b493b44cedf1647 Mon Sep 17 00:00:00 2001 -From: Eric Hawicz -Date: Sun, 21 Apr 2024 10:37:16 -0400 -Subject: [PATCH] Issue #857: fix a few places where json_tokener should have - been returning json_tokener_error_memory but wasn't. - ---- - json_tokener.c | 10 +++++++++- - 1 file changed, 9 insertions(+), 1 deletion(-) - -diff --git a/json_tokener.c b/json_tokener.c -index e8244a3..cc35527 100644 ---- a/json_tokener.c -+++ b/json_tokener.c -@@ -344,6 +344,7 @@ struct json_object *json_tokener_parse_ex(struct json_tokener *tok, const char * - newloc = newlocale(LC_NUMERIC_MASK, "C", duploc); - if (newloc == NULL) - { -+ tok->err = json_tokener_error_memory; - freelocale(duploc); - return NULL; - } -@@ -362,7 +363,10 @@ struct json_object *json_tokener_parse_ex(struct json_tokener *tok, const char * - { - oldlocale = strdup(tmplocale); - if (oldlocale == NULL) -+ { -+ tok->err = json_tokener_error_memory; - return NULL; -+ } - } - setlocale(LC_NUMERIC, "C"); - } -@@ -1257,7 +1261,11 @@ struct json_object *json_tokener_parse_ex(struct json_tokener *tok, const char * - goto redo_char; - - case json_tokener_state_object_value_add: -- json_object_object_add(current, obj_field_name, obj); -+ if (json_object_object_add(current, obj_field_name, obj) != 0) -+ { -+ tok->err = json_tokener_error_memory; -+ goto out; -+ } - free(obj_field_name); - obj_field_name = NULL; - saved_state = json_tokener_state_object_sep; --- -2.43.4 - 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 deleted file mode 100644 index 925d6a94233bb1298e45f25a617b47d6cf751f96..0000000000000000000000000000000000000000 --- a/backport-fix-issue-854-Set-error-json_tokener_error_memory-in.patch +++ /dev/null @@ -1,28 +0,0 @@ -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-0.17-20230812.tar.gz b/json-c-0.17-20230812.tar.gz deleted file mode 100644 index 2e3ffc8061abd5a46aab994f160542045e737470..0000000000000000000000000000000000000000 Binary files a/json-c-0.17-20230812.tar.gz and /dev/null differ diff --git a/json-c-0.18-20240915.tar.gz b/json-c-0.18-20240915.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..b97cba1f99edac8209a0caf485695679409aa498 Binary files /dev/null and b/json-c-0.18-20240915.tar.gz differ diff --git a/json-c.spec b/json-c.spec index a2ce3c1a84e04434677726c1a1be7626a27d3298..f50d133cae6de9bea3ae57102a9d6c89f3793558 100644 --- a/json-c.spec +++ b/json-c.spec @@ -1,12 +1,12 @@ %{!?_pkgdocdir:%global _pkgdocdir %{_docdir}/%{name}-%{version}} %global so_ver 5 -%global reldate 20230812 +%global reldate 20240915 Name: json-c -Version: 0.17 -Release: 3 +Version: 0.18 +Release: 1 Summary: JSON implementation in C License: MIT @@ -15,10 +15,6 @@ 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 -Patch002: backport-Handle-yet-another-out-of-memory-condition.patch -Patch003: backport-Issue-857-fix-a-few-places-where-json_tokener-should.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 @@ -89,11 +85,10 @@ if st and st.type == "link" then os.remove(path) end -%ldconfig_scriptlets - %files %license AUTHORS COPYING -%{_libdir}/lib%{name}.so.%{so_ver}* +%{_libdir}/lib%{name}.so.%{so_ver} +%{_libdir}/lib%{name}.so.%{so_ver}.* %files devel %{_includedir}/%{name} @@ -105,6 +100,9 @@ end %doc %{_pkgdocdir} %changelog +* Mon Sep 16 2024 Funda Wang - 0.18-1 +- update to 0.18 + * Mon Jun 24 2024 liweigang - 0.17-3 - add backport-Handle-yet-another-out-of-memory-condition.patch - add backport-Issue-857-fix-a-few-places-where-json_tokener-should.patch diff --git a/json-c.yaml b/json-c.yaml index 2809be4d4a47fc30f8c2ece6755563494019142e..3f7756865c835f45f8ab3e4d81cac99d0bcd92f9 100644 --- a/json-c.yaml +++ b/json-c.yaml @@ -1,4 +1,4 @@ version_control: github src_repo: json-c/json-c -tag_prefix: ^v -seperator: . +tag_prefix: ^json-c- +separator: .