diff --git a/0002-Issue-486-append-a-missing-.0-to-negative-double-val.patch b/0002-Issue-486-append-a-missing-.0-to-negative-double-val.patch deleted file mode 100644 index 3620f46601055db51cf46dc56992e3f14649eb9b..0000000000000000000000000000000000000000 --- a/0002-Issue-486-append-a-missing-.0-to-negative-double-val.patch +++ /dev/null @@ -1,68 +0,0 @@ -From 485f2a02c79da8a7b31e972f0c652f06094bcfb9 Mon Sep 17 00:00:00 2001 -From: Eric Haszlakiewicz -Date: Tue, 28 May 2019 02:44:22 +0000 -Subject: [PATCH 2/5] Issue #486: append a missing ".0" to negative double - values too. - ---- - json_object.c | 11 ++++++++--- - tests/test_double_serializer.c | 4 ++++ - tests/test_double_serializer.expected | 1 + - 3 files changed, 13 insertions(+), 3 deletions(-) - -diff --git a/json_object.c b/json_object.c -index 344af51..026dab3 100644 ---- a/json_object.c -+++ b/json_object.c -@@ -810,6 +810,7 @@ static int json_object_double_to_json_string_format(struct json_object* jso, - { - const char *std_format = "%.17g"; - int format_drops_decimals = 0; -+ int looks_numeric = 0; - - if (!format) - { -@@ -837,11 +838,15 @@ static int json_object_double_to_json_string_format(struct json_object* jso, - if (format == std_format || strstr(format, ".0f") == NULL) - format_drops_decimals = 1; - -+ looks_numeric = /* Looks like *some* kind of number */ -+ isdigit((unsigned char)buf[0]) || -+ (size > 1 && buf[0] == '-' && isdigit((unsigned char)buf[1])); -+ - if (size < (int)sizeof(buf) - 2 && -- isdigit((unsigned char)buf[0]) && /* Looks like *some* kind of number */ -- !p && /* Has no decimal point */ -+ looks_numeric && -+ !p && /* Has no decimal point */ - strchr(buf, 'e') == NULL && /* Not scientific notation */ -- format_drops_decimals) -+ format_drops_decimals) - { - // Ensure it looks like a float, even if snprintf didn't, - // unless a custom format is set to omit the decimal. -diff --git a/tests/test_double_serializer.c b/tests/test_double_serializer.c -index 0f7a60e..21612c8 100644 ---- a/tests/test_double_serializer.c -+++ b/tests/test_double_serializer.c -@@ -74,4 +74,8 @@ int main() - printf("ERROR: json_c_set_serialization_double_format() failed"); - - json_object_put(obj); -+ -+ obj = json_object_new_double(-12.0); -+ printf("obj(-12.0).to_string(default format)=%s\n", json_object_to_json_string(obj)); -+ - } -diff --git a/tests/test_double_serializer.expected b/tests/test_double_serializer.expected -index 98eea1e..d3aef72 100644 ---- a/tests/test_double_serializer.expected -+++ b/tests/test_double_serializer.expected -@@ -16,3 +16,4 @@ obj(12.0).to_string(default format)=12.0 - obj(12.0).to_string(%.0f)=12 - obj(12.0).to_string(%.0g)=1e+01 - obj(12.0).to_string(%.1g)=12.0 -+obj(-12.0).to_string(default format)=-12.0 --- -1.8.3.1 - diff --git a/0012-json_object_private-Use-unsigned-32-bit-integer-type.patch b/0012-json_object_private-Use-unsigned-32-bit-integer-type.patch deleted file mode 100644 index 27f685c96710962dee69a8db4236c4f149aaca0c..0000000000000000000000000000000000000000 --- a/0012-json_object_private-Use-unsigned-32-bit-integer-type.patch +++ /dev/null @@ -1,41 +0,0 @@ -From c233f5c05e92909a764973524a03471bfad78f09 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= -Date: Sat, 16 Dec 2017 17:09:39 +0100 -Subject: [PATCH 12/56] json_object_private: Use unsigned 32-bit integer type - for refcount - ---- - json_object.c | 3 +++ - json_object_private.h | 2 +- - 2 files changed, 4 insertions(+), 1 deletion(-) - -diff --git a/json_object.c b/json_object.c -index 7c7438d..da96f4c 100644 ---- a/json_object.c -+++ b/json_object.c -@@ -169,6 +169,9 @@ extern struct json_object* json_object_get(struct json_object *jso) - { - if (!jso) return jso; - -+ // Don't overflow the refcounter. -+ assert(jso->_ref_count < UINT_FAST32_MAX); -+ - #if defined(HAVE_ATOMIC_BUILTINS) && defined(ENABLE_THREADING) - __sync_add_and_fetch(&jso->_ref_count, 1); - #else -diff --git a/json_object_private.h b/json_object_private.h -index 53be70d..51134b6 100644 ---- a/json_object_private.h -+++ b/json_object_private.h -@@ -29,7 +29,7 @@ struct json_object - enum json_type o_type; - json_object_private_delete_fn *_delete; - json_object_to_json_string_fn *_to_json_string; -- int _ref_count; -+ uint_fast32_t _ref_count; - struct printbuf *_pb; - union data { - json_bool c_boolean; --- -1.8.3.1 - diff --git a/0040-Fixed-misalignment-in-JSON-string-due-to-space-after.patch b/0040-Fixed-misalignment-in-JSON-string-due-to-space-after.patch deleted file mode 100644 index 0b1638bc783e28fd0ef6aa601255345b01fd3505..0000000000000000000000000000000000000000 --- a/0040-Fixed-misalignment-in-JSON-string-due-to-space-after.patch +++ /dev/null @@ -1,36 +0,0 @@ -From e8cec5c9e47676ebc51f1ab0af904fc4417b2166 Mon Sep 17 00:00:00 2001 -From: Darjan Krijan -Date: Tue, 20 Nov 2018 22:21:27 +0100 -Subject: [PATCH 40/56] Fixed misalignment in JSON string due to space after \n - being printed when choosing JSON_C_TO_STRING_SPACED together with - JSON_C_TO_STRING_PRETTY in json_object_array_to_json_string - ---- - json_object.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/json_object.c b/json_object.c -index 8a86bc6..19f9c83 100644 ---- a/json_object.c -+++ b/json_object.c -@@ -395,7 +395,7 @@ static int json_object_object_to_json_string(struct json_object* jso, - printbuf_strappend(pb, "\n"); - } - had_children = 1; -- if (flags & JSON_C_TO_STRING_SPACED) -+ if (flags & JSON_C_TO_STRING_SPACED && !(flags & JSON_C_TO_STRING_PRETTY)) - printbuf_strappend(pb, " "); - indent(pb, level+1, flags); - printbuf_strappend(pb, "\""); -@@ -416,7 +416,7 @@ static int json_object_object_to_json_string(struct json_object* jso, - printbuf_strappend(pb, "\n"); - indent(pb,level,flags); - } -- if (flags & JSON_C_TO_STRING_SPACED) -+ if (flags & JSON_C_TO_STRING_SPACED && !(flags & JSON_C_TO_STRING_PRETTY)) - return printbuf_strappend(pb, /*{*/ " }"); - else - return printbuf_strappend(pb, /*{*/ "}"); --- -1.8.3.1 - diff --git a/0048-json_object.c-set-errno-in-json_object_get_double.patch b/0048-json_object.c-set-errno-in-json_object_get_double.patch deleted file mode 100644 index 4807bceb4430eb67a12b462e757dcb4fb4b4cd02..0000000000000000000000000000000000000000 --- a/0048-json_object.c-set-errno-in-json_object_get_double.patch +++ /dev/null @@ -1,63 +0,0 @@ -From 506a32d4ab2acbdf2315719c2ae74c40c616670b Mon Sep 17 00:00:00 2001 -From: andy5995 -Date: Mon, 26 Nov 2018 21:12:06 -0600 -Subject: [PATCH 48/56] json_object.c:set errno in json_object_get_double() - -closes #422 ---- - json_object.c | 11 +++++++++-- - json_tokener.h | 2 +- - 2 files changed, 10 insertions(+), 3 deletions(-) - -diff --git a/json_object.c b/json_object.c -index 8a86bc6..4b2b014 100644 ---- a/json_object.c -+++ b/json_object.c -@@ -951,7 +951,10 @@ double json_object_get_double(const struct json_object *jso) - - /* if conversion stopped at the first character, return 0.0 */ - if (errPtr == get_string_component(jso)) -- return 0.0; -+ { -+ errno = EINVAL; -+ return 0.0; -+ } - - /* - * Check that the conversion terminated on something sensible -@@ -959,7 +962,10 @@ double json_object_get_double(const struct json_object *jso) - * For example, { "pay" : 123AB } would parse as 123. - */ - if (*errPtr != '\0') -- return 0.0; -+ { -+ errno = EINVAL; -+ return 0.0; -+ } - - /* - * If strtod encounters a string which would exceed the -@@ -977,6 +983,7 @@ double json_object_get_double(const struct json_object *jso) - cdouble = 0.0; - return cdouble; - default: -+ errno = EINVAL; - return 0.0; - } - } -diff --git a/json_tokener.h b/json_tokener.h -index 8bcc6b6..4801c65 100644 ---- a/json_tokener.h -+++ b/json_tokener.h -@@ -122,7 +122,7 @@ const char *json_tokener_error_desc(enum json_tokener_error jerr); - * When parsing a JSON string in pieces, if the tokener is in the middle - * of parsing this will return json_tokener_continue. - * -- * See also json_tokener_error_desc(). -+ * @see json_tokener_error_desc(). - */ - JSON_EXPORT enum json_tokener_error json_tokener_get_error(struct json_tokener *tok); - --- -1.8.3.1 - diff --git a/0053-Fix-compiler-warnings.patch b/0053-Fix-compiler-warnings.patch deleted file mode 100644 index 824755265fd556c7c1b50be012ed333d66fb51a6..0000000000000000000000000000000000000000 --- a/0053-Fix-compiler-warnings.patch +++ /dev/null @@ -1,138 +0,0 @@ -From 3003161effc3286b749010ada9182b79dbfe8c57 Mon Sep 17 00:00:00 2001 -From: Rubasri Kalidas -Date: Tue, 18 Dec 2018 11:30:57 -0600 -Subject: [PATCH 53/56] Fix compiler warnings - ---- - linkhash.c | 4 ++++ - random_seed.c | 24 ++++++++++++------------ - random_seed.h | 2 +- - 3 files changed, 17 insertions(+), 13 deletions(-) - -diff --git a/linkhash.c b/linkhash.c -index b1223c4..f324a10 100644 ---- a/linkhash.c -+++ b/linkhash.c -@@ -36,6 +36,10 @@ static unsigned long lh_char_hash(const void *k); - static unsigned long lh_perllike_str_hash(const void *k); - static lh_hash_fn *char_hash_fn = lh_char_hash; - -+/* comparison functions */ -+int lh_char_equal(const void *k1, const void *k2); -+int lh_ptr_equal(const void *k1, const void *k2); -+ - int - json_global_set_string_hash(const int h) - { -diff --git a/random_seed.c b/random_seed.c -index 3232777..97d9547 100644 ---- a/random_seed.c -+++ b/random_seed.c -@@ -53,7 +53,7 @@ static void do_cpuid(int regs[], int h) - - #if HAS_X86_CPUID - --static int has_rdrand() -+static int has_rdrand(void) - { - // CPUID.01H:ECX.RDRAND[bit 30] == 1 - int regs[4]; -@@ -69,7 +69,7 @@ static int has_rdrand() - - #define HAVE_RDRAND 1 - --static int get_rdrand_seed() -+static int get_rdrand_seed(void) - { - DEBUG_SEED("get_rdrand_seed"); - int _eax; -@@ -91,7 +91,7 @@ static int get_rdrand_seed() - - /* get_rdrand_seed - Visual Studio 2012 and above */ - --static int get_rdrand_seed() -+static int get_rdrand_seed(void) - { - DEBUG_SEED("get_rdrand_seed"); - int r; -@@ -104,7 +104,7 @@ static int get_rdrand_seed() - - /* get_rdrand_seed - Visual Studio 2010 and below - x86 only */ - --static int get_rdrand_seed() -+static int get_rdrand_seed(void) - { - DEBUG_SEED("get_rdrand_seed"); - int _eax; -@@ -136,7 +136,7 @@ retry: - - static const char *dev_random_file = "/dev/urandom"; - --static int has_dev_urandom() -+static int has_dev_urandom(void) - { - struct stat buf; - if (stat(dev_random_file, &buf)) { -@@ -148,7 +148,7 @@ static int has_dev_urandom() - - /* get_dev_random_seed */ - --static int get_dev_random_seed() -+static int get_dev_random_seed(void) - { - DEBUG_SEED("get_dev_random_seed"); - -@@ -184,7 +184,7 @@ static int get_dev_random_seed() - #pragma comment(lib, "advapi32.lib") - #endif - --static int get_cryptgenrandom_seed() -+static int get_cryptgenrandom_seed(void) - { - HCRYPTPROV hProvider = 0; - int r; -@@ -213,7 +213,7 @@ static int get_cryptgenrandom_seed() - - #include - --static int get_time_seed() -+static int get_time_seed(void) - { - DEBUG_SEED("get_time_seed"); - -@@ -223,15 +223,15 @@ static int get_time_seed() - - /* json_c_get_random_seed */ - --int json_c_get_random_seed() -+int json_c_get_random_seed(void) - { --#if HAVE_RDRAND -+#if defined HAVE_RDRAND && HAVE_RDRAND - if (has_rdrand()) return get_rdrand_seed(); - #endif --#if HAVE_DEV_RANDOM -+#if defined HAVE_DEV_RANDOM && HAVE_DEV_RANDOM - if (has_dev_urandom()) return get_dev_random_seed(); - #endif --#if HAVE_CRYPTGENRANDOM -+#if defined HAVE_CRYPTGENRANDOM && HAVE_CRYPTGENRANDOM - return get_cryptgenrandom_seed(); - #endif - return get_time_seed(); -diff --git a/random_seed.h b/random_seed.h -index 2f43dad..72ee5f6 100644 ---- a/random_seed.h -+++ b/random_seed.h -@@ -20,7 +20,7 @@ - extern "C" { - #endif - --extern int json_c_get_random_seed(); -+extern int json_c_get_random_seed(void); - - #ifdef __cplusplus - } --- -1.8.3.1 - diff --git a/CVE-2020-12762.patch b/CVE-2020-12762.patch deleted file mode 100644 index f935b4d2ada6a91aff549fe3821ee8882f1603fd..0000000000000000000000000000000000000000 --- a/CVE-2020-12762.patch +++ /dev/null @@ -1,215 +0,0 @@ -From 865b5a65199973bb63dff8e47a2f57e04fec9736 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= -Date: Thu, 14 May 2020 12:32:30 +0200 -Subject: [PATCH] Fix CVE-2020-12762. - -This commit is a squashed backport of the following commits -on the master branch: - - * 099016b7e8d70a6d5dd814e788bba08d33d48426 - * 77d935b7ae7871a1940cd827e850e6063044ec45 - * d07b91014986900a3a75f306d302e13e005e9d67 - * 519dfe1591d85432986f9762d41d1a883198c157 - * a59d5acfab4485d5133114df61785b1fc633e0c6 - -diff -Naur a/arraylist.c b/arraylist.c ---- a/arraylist.c 2020-05-22 09:46:16.533075050 +0800 -+++ b/arraylist.c 2020-05-22 10:23:23.116574972 +0800 -@@ -135,6 +135,9 @@ - { - size_t i, stop; - -+ /* Avoid overflow in calculation with large indices. */ -+ if (idx > SIZE_T_MAX - count) -+ return -1; - stop = idx + count; - if ( idx >= arr->length || stop > arr->length ) return -1; - for ( i = idx; i < stop; ++i ) { -diff -Naur a/linkhash.c b/linkhash.c ---- a/linkhash.c 2020-05-22 09:46:16.533075050 +0800 -+++ b/linkhash.c 2020-05-22 10:22:12.396465606 +0800 -@@ -12,12 +12,13 @@ - - #include "config.h" - --#include --#include --#include -+#include -+#include - #include - #include --#include -+#include -+#include -+#include - - #ifdef HAVE_ENDIAN_H - # include /* attempt to define endianness */ -@@ -28,8 +29,8 @@ - # include /* Get InterlockedCompareExchange */ - #endif - --#include "random_seed.h" - #include "linkhash.h" -+#include "random_seed.h" - - /* hash functions */ - static unsigned long lh_char_hash(const void *k); -@@ -502,7 +503,9 @@ - int i; - struct lh_table *t; - -- t = (struct lh_table*)calloc(1, sizeof(struct lh_table)); -+ /* Allocate space for elements to avoid divisions by zero. */ -+ assert(size > 0); -+ t = (struct lh_table *)calloc(1, sizeof(struct lh_table)); - if (!t) - return NULL; - -@@ -581,8 +584,12 @@ - unsigned long n; - - if (t->count >= t->size * LH_LOAD_FACTOR) -- if (lh_table_resize(t, t->size * 2) != 0) -+ { -+ /* Avoid signed integer overflow with large tables. */ -+ int new_size = (t->size > INT_MAX / 2) ? INT_MAX : (t->size * 2); -+ if (t->size == INT_MAX || lh_table_resize(t, new_size) != 0) - return -1; -+ } - - n = h % t->size; - -diff -Naur a/printbuf.c b/printbuf.c ---- a/printbuf.c 2020-05-22 09:46:16.533075050 +0800 -+++ b/printbuf.c 2020-05-22 10:32:49.527452767 +0800 -@@ -15,6 +15,7 @@ - - #include "config.h" - -+#include - #include - #include - #include -@@ -64,10 +65,16 @@ - - if (p->size >= min_size) - return 0; -- -- new_size = p->size * 2; -- if (new_size < min_size + 8) -- new_size = min_size + 8; -+ /* Prevent signed integer overflows with large buffers. */ -+ if (min_size > INT_MAX - 8) -+ return -1; -+ if (p->size > INT_MAX / 2) -+ new_size = min_size + 8; -+ else { -+ new_size = p->size * 2; -+ if (new_size < min_size + 8) -+ new_size = min_size + 8; -+ } - #ifdef PRINTBUF_DEBUG - MC_DEBUG("printbuf_memappend: realloc " - "bpos=%d min_size=%d old_size=%d new_size=%d\n", -@@ -82,14 +89,18 @@ - - int printbuf_memappend(struct printbuf *p, const char *buf, int size) - { -- if (p->size <= p->bpos + size + 1) { -- if (printbuf_extend(p, p->bpos + size + 1) < 0) -- return -1; -- } -- memcpy(p->buf + p->bpos, buf, size); -- p->bpos += size; -- p->buf[p->bpos]= '\0'; -- return size; -+ /* Prevent signed integer overflows with large buffers. */ -+ if (size > INT_MAX - p->bpos - 1) -+ return -1; -+ if (p->size <= p->bpos + size + 1) -+ { -+ if (printbuf_extend(p, p->bpos + size + 1) < 0) -+ return -1; -+ } -+ memcpy(p->buf + p->bpos, buf, size); -+ p->bpos += size; -+ p->buf[p->bpos] = '\0'; -+ return size; - } - - int printbuf_memset(struct printbuf *pb, int offset, int charvalue, int len) -@@ -98,6 +109,9 @@ - - if (offset == -1) - offset = pb->bpos; -+ /* Prevent signed integer overflows with large buffers. */ -+ if (len > INT_MAX - offset) -+ return -1; - size_needed = offset + len; - if (pb->size < size_needed) - { -diff -Naur a/tests/test4.c b/tests/test4.c ---- a/tests/test4.c 2020-05-22 09:46:16.543075066 +0800 -+++ b/tests/test4.c 2020-05-22 10:37:39.307903043 +0800 -@@ -2,9 +2,11 @@ - * gcc -o utf8 utf8.c -I/home/y/include -L./.libs -ljson - */ - -+#include "config.h" -+#include - #include -+#include - #include --#include "config.h" - - #include "json_inttypes.h" - #include "json_object.h" -@@ -24,6 +26,29 @@ - putchar('\n'); - } - -+static void test_lot_of_adds(void); -+static void test_lot_of_adds() -+{ -+ int ii; -+ char key[50]; -+ json_object *jobj = json_object_new_object(); -+ assert(jobj != NULL); -+ for (ii = 0; ii < 500; ii++) -+ { -+ snprintf(key, sizeof(key), "k%d", ii); -+ json_object *iobj = json_object_new_int(ii); -+ assert(iobj != NULL); -+ if (json_object_object_add(jobj, key, iobj)) -+ { -+ fprintf(stderr, "FAILED to add object #%d\n", ii); -+ abort(); -+ } -+ } -+ printf("%s\n", json_object_to_json_string(jobj)); -+ assert(json_object_object_length(jobj) == 500); -+ json_object_put(jobj); -+} -+ - int main(void) - { - const char *input = "\"\\ud840\\udd26,\\ud840\\udd27,\\ud800\\udd26,\\ud800\\udd27\""; -@@ -49,5 +74,8 @@ - retval = 1; - } - json_object_put(parse_result); -+ -+ test_lot_of_adds(); -+ - return retval; - } -diff -Naur a/tests/test4.expected b/tests/test4.expected ---- a/tests/test4.expected 2020-05-22 09:46:16.543075066 +0800 -+++ b/tests/test4.expected 2020-05-22 10:38:38.467995061 +0800 -@@ -1,3 +1,4 @@ - input: "\ud840\udd26,\ud840\udd27,\ud800\udd26,\ud800\udd27" - JSON parse result is correct: 𠄦,𠄧,𐄦,𐄧 - PASS -+{ "k0": 0, "k1": 1, "k2": 2, "k3": 3, "k4": 4, "k5": 5, "k6": 6, "k7": 7, "k8": 8, "k9": 9, "k10": 10, "k11": 11, "k12": 12, "k13": 13, "k14": 14, "k15": 15, "k16": 16, "k17": 17, "k18": 18, "k19": 19, "k20": 20, "k21": 21, "k22": 22, "k23": 23, "k24": 24, "k25": 25, "k26": 26, "k27": 27, "k28": 28, "k29": 29, "k30": 30, "k31": 31, "k32": 32, "k33": 33, "k34": 34, "k35": 35, "k36": 36, "k37": 37, "k38": 38, "k39": 39, "k40": 40, "k41": 41, "k42": 42, "k43": 43, "k44": 44, "k45": 45, "k46": 46, "k47": 47, "k48": 48, "k49": 49, "k50": 50, "k51": 51, "k52": 52, "k53": 53, "k54": 54, "k55": 55, "k56": 56, "k57": 57, "k58": 58, "k59": 59, "k60": 60, "k61": 61, "k62": 62, "k63": 63, "k64": 64, "k65": 65, "k66": 66, "k67": 67, "k68": 68, "k69": 69, "k70": 70, "k71": 71, "k72": 72, "k73": 73, "k74": 74, "k75": 75, "k76": 76, "k77": 77, "k78": 78, "k79": 79, "k80": 80, "k81": 81, "k82": 82, "k83": 83, "k84": 84, "k85": 85, "k86": 86, "k87": 87, "k88": 88, "k89": 89, "k90": 90, "k91": 91, "k92": 92, "k93": 93, "k94": 94, "k95": 95, "k96": 96, "k97": 97, "k98": 98, "k99": 99, "k100": 100, "k101": 101, "k102": 102, "k103": 103, "k104": 104, "k105": 105, "k106": 106, "k107": 107, "k108": 108, "k109": 109, "k110": 110, "k111": 111, "k112": 112, "k113": 113, "k114": 114, "k115": 115, "k116": 116, "k117": 117, "k118": 118, "k119": 119, "k120": 120, "k121": 121, "k122": 122, "k123": 123, "k124": 124, "k125": 125, "k126": 126, "k127": 127, "k128": 128, "k129": 129, "k130": 130, "k131": 131, "k132": 132, "k133": 133, "k134": 134, "k135": 135, "k136": 136, "k137": 137, "k138": 138, "k139": 139, "k140": 140, "k141": 141, "k142": 142, "k143": 143, "k144": 144, "k145": 145, "k146": 146, "k147": 147, "k148": 148, "k149": 149, "k150": 150, "k151": 151, "k152": 152, "k153": 153, "k154": 154, "k155": 155, "k156": 156, "k157": 157, "k158": 158, "k159": 159, "k160": 160, "k161": 161, "k162": 162, "k163": 163, "k164": 164, "k165": 165, "k166": 166, "k167": 167, "k168": 168, "k169": 169, "k170": 170, "k171": 171, "k172": 172, "k173": 173, "k174": 174, "k175": 175, "k176": 176, "k177": 177, "k178": 178, "k179": 179, "k180": 180, "k181": 181, "k182": 182, "k183": 183, "k184": 184, "k185": 185, "k186": 186, "k187": 187, "k188": 188, "k189": 189, "k190": 190, "k191": 191, "k192": 192, "k193": 193, "k194": 194, "k195": 195, "k196": 196, "k197": 197, "k198": 198, "k199": 199, "k200": 200, "k201": 201, "k202": 202, "k203": 203, "k204": 204, "k205": 205, "k206": 206, "k207": 207, "k208": 208, "k209": 209, "k210": 210, "k211": 211, "k212": 212, "k213": 213, "k214": 214, "k215": 215, "k216": 216, "k217": 217, "k218": 218, "k219": 219, "k220": 220, "k221": 221, "k222": 222, "k223": 223, "k224": 224, "k225": 225, "k226": 226, "k227": 227, "k228": 228, "k229": 229, "k230": 230, "k231": 231, "k232": 232, "k233": 233, "k234": 234, "k235": 235, "k236": 236, "k237": 237, "k238": 238, "k239": 239, "k240": 240, "k241": 241, "k242": 242, "k243": 243, "k244": 244, "k245": 245, "k246": 246, "k247": 247, "k248": 248, "k249": 249, "k250": 250, "k251": 251, "k252": 252, "k253": 253, "k254": 254, "k255": 255, "k256": 256, "k257": 257, "k258": 258, "k259": 259, "k260": 260, "k261": 261, "k262": 262, "k263": 263, "k264": 264, "k265": 265, "k266": 266, "k267": 267, "k268": 268, "k269": 269, "k270": 270, "k271": 271, "k272": 272, "k273": 273, "k274": 274, "k275": 275, "k276": 276, "k277": 277, "k278": 278, "k279": 279, "k280": 280, "k281": 281, "k282": 282, "k283": 283, "k284": 284, "k285": 285, "k286": 286, "k287": 287, "k288": 288, "k289": 289, "k290": 290, "k291": 291, "k292": 292, "k293": 293, "k294": 294, "k295": 295, "k296": 296, "k297": 297, "k298": 298, "k299": 299, "k300": 300, "k301": 301, "k302": 302, "k303": 303, "k304": 304, "k305": 305, "k306": 306, "k307": 307, "k308": 308, "k309": 309, "k310": 310, "k311": 311, "k312": 312, "k313": 313, "k314": 314, "k315": 315, "k316": 316, "k317": 317, "k318": 318, "k319": 319, "k320": 320, "k321": 321, "k322": 322, "k323": 323, "k324": 324, "k325": 325, "k326": 326, "k327": 327, "k328": 328, "k329": 329, "k330": 330, "k331": 331, "k332": 332, "k333": 333, "k334": 334, "k335": 335, "k336": 336, "k337": 337, "k338": 338, "k339": 339, "k340": 340, "k341": 341, "k342": 342, "k343": 343, "k344": 344, "k345": 345, "k346": 346, "k347": 347, "k348": 348, "k349": 349, "k350": 350, "k351": 351, "k352": 352, "k353": 353, "k354": 354, "k355": 355, "k356": 356, "k357": 357, "k358": 358, "k359": 359, "k360": 360, "k361": 361, "k362": 362, "k363": 363, "k364": 364, "k365": 365, "k366": 366, "k367": 367, "k368": 368, "k369": 369, "k370": 370, "k371": 371, "k372": 372, "k373": 373, "k374": 374, "k375": 375, "k376": 376, "k377": 377, "k378": 378, "k379": 379, "k380": 380, "k381": 381, "k382": 382, "k383": 383, "k384": 384, "k385": 385, "k386": 386, "k387": 387, "k388": 388, "k389": 389, "k390": 390, "k391": 391, "k392": 392, "k393": 393, "k394": 394, "k395": 395, "k396": 396, "k397": 397, "k398": 398, "k399": 399, "k400": 400, "k401": 401, "k402": 402, "k403": 403, "k404": 404, "k405": 405, "k406": 406, "k407": 407, "k408": 408, "k409": 409, "k410": 410, "k411": 411, "k412": 412, "k413": 413, "k414": 414, "k415": 415, "k416": 416, "k417": 417, "k418": 418, "k419": 419, "k420": 420, "k421": 421, "k422": 422, "k423": 423, "k424": 424, "k425": 425, "k426": 426, "k427": 427, "k428": 428, "k429": 429, "k430": 430, "k431": 431, "k432": 432, "k433": 433, "k434": 434, "k435": 435, "k436": 436, "k437": 437, "k438": 438, "k439": 439, "k440": 440, "k441": 441, "k442": 442, "k443": 443, "k444": 444, "k445": 445, "k446": 446, "k447": 447, "k448": 448, "k449": 449, "k450": 450, "k451": 451, "k452": 452, "k453": 453, "k454": 454, "k455": 455, "k456": 456, "k457": 457, "k458": 458, "k459": 459, "k460": 460, "k461": 461, "k462": 462, "k463": 463, "k464": 464, "k465": 465, "k466": 466, "k467": 467, "k468": 468, "k469": 469, "k470": 470, "k471": 471, "k472": 472, "k473": 473, "k474": 474, "k475": 475, "k476": 476, "k477": 477, "k478": 478, "k479": 479, "k480": 480, "k481": 481, "k482": 482, "k483": 483, "k484": 484, "k485": 485, "k486": 486, "k487": 487, "k488": 488, "k489": 489, "k490": 490, "k491": 491, "k492": 492, "k493": 493, "k494": 494, "k495": 495, "k496": 496, "k497": 497, "k498": 498, "k499": 499 } diff --git a/backport-Detect-broken-RDRAND-during-initialization.patch b/backport-Detect-broken-RDRAND-during-initialization.patch deleted file mode 100644 index c902f8ccb6c66020a6fe2d38ebfc8b5da0de7c89..0000000000000000000000000000000000000000 --- a/backport-Detect-broken-RDRAND-during-initialization.patch +++ /dev/null @@ -1,70 +0,0 @@ -From 4d36b0287d3ab0912ba8a4790340ca099960b2b0 Mon Sep 17 00:00:00 2001 -From: Tudor Brindus -Date: Fri, 1 May 2020 21:09:22 -0400 -Subject: [PATCH] Detect broken RDRAND during initialization - -Some CPUs advertise RDRAND in CPUID, but return 0xFFFFFFFF -unconditionally. To avoid locking up later, test RDRAND during -initialization, and if it returns 0xFFFFFFFF, mark it as nonexistent. - -Fixes #588. - -Conflict:NA -Reference:https://github.com/json-c/json-c/commit/4d36b0287d3ab0912ba8a4790340ca099960b2b0 ---- - random_seed.c | 37 +++++++++++++++++++++++++++++++++---- - 1 file changed, 33 insertions(+), 4 deletions(-) - -diff --git a/random_seed.c b/random_seed.c -index 97d9547..b97dbd1 100644 ---- a/random_seed.c -+++ b/random_seed.c -@@ -53,12 +53,41 @@ static void do_cpuid(int regs[], int h) - - #if HAS_X86_CPUID - -+static int get_rdrand_seed(void); -+ -+// Valid values are -1 (haven't tested), 0 (no), and 1 (yes). -+static int _has_rdrand = -1; -+ - static int has_rdrand(void) - { -- // CPUID.01H:ECX.RDRAND[bit 30] == 1 -- int regs[4]; -- do_cpuid(regs, 1); -- return (regs[2] & (1 << 30)) != 0; -+ if (_has_rdrand == -1) -+ { -+ // CPUID.01H:ECX.RDRAND[bit 30] == 1 -+ int regs[4]; -+ do_cpuid(regs, 1); -+ if (!(regs[2] & (1 << 30))) -+ { -+ _has_rdrand = 0; -+ } else -+ { -+ // Some CPUs advertise RDRAND in CPUID, but return 0xFFFFFFFF -+ // unconditionally. To avoid locking up later, test RDRAND here. If over -+ // 10 trials RDRAND has returned the same value, declare it broken. -+ _has_rdrand = 0; -+ int prev = get_rdrand_seed(); -+ for (int i = 0; i < 10; i++) { -+ int temp = get_rdrand_seed(); -+ if (temp != prev) { -+ _has_rdrand = 1; -+ break; -+ } -+ -+ prev = temp; -+ } -+ } -+ } -+ -+ return _has_rdrand; - } - - #endif --- -2.27.0 - diff --git a/backport-drop-the-rdrand-test-loops.patch b/backport-drop-the-rdrand-test-loops.patch deleted file mode 100644 index 89d6d3e93d84b957c8a14f56662d45dc535ddac2..0000000000000000000000000000000000000000 --- a/backport-drop-the-rdrand-test-loops.patch +++ /dev/null @@ -1,118 +0,0 @@ -From 80863140263be5f2dc630938ed8f0066f8a1ab43 Mon Sep 17 00:00:00 2001 -From: Eric Haszlakiewicz -Date: Mon, 4 May 2020 01:29:02 +0000 -Subject: [PATCH] Issue #589: drop the rdrand test loops to just 3, tweak - comments and add some links to bug reports, and decrease the nesting level of - the has_rdrand() function. - -Conflict:NA -Reference:https://github.com/json-c/json-c/commit/80863140263be5f2dc630938ed8f0066f8a1ab43 ---- - random_seed.c | 63 +++++++++++++++++++++++++++++++-------------------- - 1 file changed, 38 insertions(+), 25 deletions(-) - -diff --git a/random_seed.c b/random_seed.c -index b97dbd1..8bbc467 100644 ---- a/random_seed.c -+++ b/random_seed.c -@@ -55,36 +55,45 @@ static void do_cpuid(int regs[], int h) - - static int get_rdrand_seed(void); - --// Valid values are -1 (haven't tested), 0 (no), and 1 (yes). -+/* Valid values are -1 (haven't tested), 0 (no), and 1 (yes). */ - static int _has_rdrand = -1; - - static int has_rdrand(void) - { -- if (_has_rdrand == -1) -+ if (_has_rdrand != -1) - { -- // CPUID.01H:ECX.RDRAND[bit 30] == 1 -- int regs[4]; -- do_cpuid(regs, 1); -- if (!(regs[2] & (1 << 30))) -- { -- _has_rdrand = 0; -- } else -+ return _has_rdrand; -+ } -+ -+ /* CPUID.01H:ECX.RDRAND[bit 30] == 1 */ -+ int regs[4]; -+ do_cpuid(regs, 1); -+ if (!(regs[2] & (1 << 30))) -+ { -+ _has_rdrand = 0; -+ return 0; -+ } -+ -+ /* -+ * Some CPUs advertise RDRAND in CPUID, but return 0xFFFFFFFF -+ * unconditionally. To avoid locking up later, test RDRAND here. If over -+ * 3 trials RDRAND has returned the same value, declare it broken. -+ * Example CPUs are AMD Ryzen 3000 series -+ * and much older AMD APUs, such as the E1-1500 -+ * https://github.com/systemd/systemd/issues/11810 -+ * https://linuxreviews.org/RDRAND_stops_returning_random_values_on_older_AMD_CPUs_after_suspend -+ */ -+ _has_rdrand = 0; -+ int prev = get_rdrand_seed(); -+ for (int i = 0; i < 3; i++) -+ { -+ int temp = get_rdrand_seed(); -+ if (temp != prev) - { -- // Some CPUs advertise RDRAND in CPUID, but return 0xFFFFFFFF -- // unconditionally. To avoid locking up later, test RDRAND here. If over -- // 10 trials RDRAND has returned the same value, declare it broken. -- _has_rdrand = 0; -- int prev = get_rdrand_seed(); -- for (int i = 0; i < 10; i++) { -- int temp = get_rdrand_seed(); -- if (temp != prev) { -- _has_rdrand = 1; -- break; -- } -- -- prev = temp; -- } -+ _has_rdrand = 1; -+ break; - } -+ prev = temp; - } - - return _has_rdrand; -@@ -102,7 +111,7 @@ static int get_rdrand_seed(void) - { - DEBUG_SEED("get_rdrand_seed"); - int _eax; -- // rdrand eax -+ /* rdrand eax */ - __asm__ __volatile__("1: .byte 0x0F\n" - " .byte 0xC7\n" - " .byte 0xF0\n" -@@ -138,7 +147,7 @@ static int get_rdrand_seed(void) - DEBUG_SEED("get_rdrand_seed"); - int _eax; - retry: -- // rdrand eax -+ /* rdrand eax */ - __asm _emit 0x0F __asm _emit 0xC7 __asm _emit 0xF0 - __asm jnc retry - __asm mov _eax, eax -@@ -208,6 +217,10 @@ static int get_dev_random_seed(void) - #define HAVE_CRYPTGENRANDOM 1 - - #include -+ -+/* Caution: these blank lines must remain so clang-format doesn't reorder -+ includes to put windows.h after wincrypt.h */ -+ - #include - #ifndef __GNUC__ - #pragma comment(lib, "advapi32.lib") --- -2.27.0 - diff --git a/bugfix-json-c-support_aarch64.patch b/bugfix-json-c-support_aarch64.patch deleted file mode 100644 index a00e87ec66c30cf822a2659b369838b09a412eaa..0000000000000000000000000000000000000000 --- a/bugfix-json-c-support_aarch64.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -Nur json-c-json-c-0.11-20130402_orig/config.sub json-c-json-c-0.11-20130402//config.sub ---- json-c-json-c-0.11-20130402_orig/config.sub 2017-10-25 18:54:05.000000000 +0800 -+++ json-c-json-c-0.11-20130402//config.sub 2017-10-25 19:25:49.000000000 +0800 -@@ -250,6 +250,7 @@ - | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ - | avr | avr32 \ - | be32 | be64 \ -+ | aarch64_[bl]e-linux | aarch64_[bl]e-euler \ - | bfin \ - | c4x | c8051 | clipper \ - | d10v | d30v | dlx | dsp16xx \ diff --git a/json-c-0.13.1-20180305.tar.gz b/json-c-0.13.1-20180305.tar.gz deleted file mode 100644 index 34f5b746d54cb1cf70de061778022ae535071593..0000000000000000000000000000000000000000 Binary files a/json-c-0.13.1-20180305.tar.gz and /dev/null differ diff --git a/json-c-0.13.1-fix_incorrect_casts_in_calls_to_ctype_functions.patch b/json-c-0.13.1-fix_incorrect_casts_in_calls_to_ctype_functions.patch deleted file mode 100644 index e88d6e2bbfb9efacfe8042cf670468c5bc8d4463..0000000000000000000000000000000000000000 --- a/json-c-0.13.1-fix_incorrect_casts_in_calls_to_ctype_functions.patch +++ /dev/null @@ -1,61 +0,0 @@ -From f8c632f579c71012f9aca81543b880a579f634fc Mon Sep 17 00:00:00 2001 -From: Eric Haszlakiewicz -Date: Sun, 25 Mar 2018 18:25:58 -0400 -Subject: [PATCH] Issue #407: fix incorrect casts in calls to ctype functions - (isdigit and isspace) so we don't crash when asserts are enabled on certain - platforms and characters > 128 are parsed. - ---- - json_object.c | 2 +- - json_pointer.c | 4 ++-- - json_tokener.c | 2 +- - 3 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/json_object.c b/json_object.c -index 8287163a1c..8a86bc6ea0 100644 ---- a/json_object.c -+++ b/json_object.c -@@ -838,7 +838,7 @@ static int json_object_double_to_json_string_format(struct json_object* jso, - format_drops_decimals = 1; - - if (size < (int)sizeof(buf) - 2 && -- isdigit((int)buf[0]) && /* Looks like *some* kind of number */ -+ isdigit((unsigned char)buf[0]) && /* Looks like *some* kind of number */ - !p && /* Has no decimal point */ - strchr(buf, 'e') == NULL && /* Not scientific notation */ - format_drops_decimals) -diff --git a/json_pointer.c b/json_pointer.c -index 2b2a9ef507..c7e34f76f3 100644 ---- a/json_pointer.c -+++ b/json_pointer.c -@@ -44,7 +44,7 @@ static int is_valid_index(struct json_object *jo, const char *path, int32_t *idx - /* this code-path optimizes a bit, for when we reference the 0-9 index range in a JSON array - and because leading zeros not allowed */ - if (len == 1) { -- if (isdigit((int)path[0])) { -+ if (isdigit((unsigned char)path[0])) { - *idx = (path[0] - '0'); - goto check_oob; - } -@@ -58,7 +58,7 @@ static int is_valid_index(struct json_object *jo, const char *path, int32_t *idx - } - /* RFC states base-10 decimals */ - for (i = 0; i < len; i++) { -- if (!isdigit((int)path[i])) { -+ if (!isdigit((unsigned char)path[i])) { - errno = EINVAL; - return 0; - } -diff --git a/json_tokener.c b/json_tokener.c -index 449a82da6f..561f7303b2 100644 ---- a/json_tokener.c -+++ b/json_tokener.c -@@ -295,7 +295,7 @@ struct json_object* json_tokener_parse_ex(struct json_tokener *tok, - - case json_tokener_state_eatws: - /* Advance until we change state */ -- while (isspace((int)c)) { -+ while (isspace((unsigned char)c)) { - if ((!ADVANCE_CHAR(str, tok)) || (!PEEK_CHAR(c, tok))) - goto out; - } diff --git a/json-c-0.13.1-fix_typos.patch b/json-c-0.13.1-fix_typos.patch deleted file mode 100644 index 25301d7f1a3e2395ddec39107f1d6cbf8ad6c036..0000000000000000000000000000000000000000 --- a/json-c-0.13.1-fix_typos.patch +++ /dev/null @@ -1,163 +0,0 @@ -From 8bd62177e796386fb6382db101c90b57b6138afe Mon Sep 17 00:00:00 2001 -From: janczer -Date: Tue, 24 Apr 2018 16:00:38 +0200 -Subject: [PATCH] Fixed typos - ---- - STYLE.txt | 2 +- - json_object.h | 18 +++++++++--------- - json_pointer.c | 2 +- - tests/test_compare.c | 12 ++++++------ - tests/test_compare.expected | 6 +++--- - 5 files changed, 20 insertions(+), 20 deletions(-) - -diff --git a/STYLE.txt b/STYLE.txt -index e5acd14820..195883c760 100755 ---- a/STYLE.txt -+++ b/STYLE.txt -@@ -7,7 +7,7 @@ Official json-c style: - Aim for readability, not strict conformance to fixed style rules. - These rules are not comprehensive. Look to existing code for guidelines. - Indentation is tab based, with continuations of long lines starting with tabs then spaces for alignment. --Try to line up components of continuation lines with corresponding part of the line above (i.e. "indent -lp" effect), but avoid excessive identation tha causes extra line wraps. -+Try to line up components of continuation lines with corresponding part of the line above (i.e. "indent -lp" effect), but avoid excessive indentation tha causes extra line wraps. - e.g. (T=tab, S=space): - TTTTsome_long_func_call(arg1, arg2, - TTTTSSSSSSSSSSSSSSSSSSSarg3, arg4); -diff --git a/json_object.h b/json_object.h -index a3a86c0912..30341bcdb7 100644 ---- a/json_object.h -+++ b/json_object.h -@@ -91,7 +91,7 @@ extern "C" { - /** - * A flag for the json_object_object_add_ex function which - * causes the value to be added without a check if it already exists. -- * Note: it is the responsibilty of the caller to ensure that no -+ * Note: it is the responsibility of the caller to ensure that no - * key is added multiple times. If this is done, results are - * unpredictable. While this option is somewhat dangerous, it - * permits potentially large performance savings in code that -@@ -442,7 +442,7 @@ JSON_EXPORT int json_object_object_add_ex(struct json_object* obj, - * - * This returns NULL if the field is found but its value is null, or if - * the field is not found, or if obj is not a json_type_object. If you -- * need to distinguis between these cases, use json_object_object_get_ex(). -+ * need to distinguish between these cases, use json_object_object_get_ex(). - * - * *No* reference counts will be changed. There is no need to manually adjust - * reference counts through the json_object_put/json_object_get methods unless -@@ -624,7 +624,7 @@ JSON_EXPORT int json_object_array_add(struct json_object *obj, - JSON_EXPORT int json_object_array_put_idx(struct json_object *obj, size_t idx, - struct json_object *val); - --/** Get the element at specificed index of the array (a json_object of type json_type_array) -+/** Get the element at specified index of the array (a json_object of type json_type_array) - * @param obj the json_object instance - * @param idx the index to get the element at - * @returns the json_object at the specified index (or NULL) -@@ -671,7 +671,7 @@ JSON_EXPORT json_bool json_object_get_boolean(const struct json_object *obj); - * - * The type of obj is checked to be a json_type_boolean and 0 is returned - * if it is not without any further actions. If type of obj is json_type_boolean -- * the obect value is chaned to new_value -+ * the object value is changed to new_value - * - * @param obj the json_object instance - * @param new_value the value to be set -@@ -718,7 +718,7 @@ JSON_EXPORT int32_t json_object_get_int(const struct json_object *obj); - * - * The type of obj is checked to be a json_type_int and 0 is returned - * if it is not without any further actions. If type of obj is json_type_int -- * the obect value is changed to new_value -+ * the object value is changed to new_value - * - * @param obj the json_object instance - * @param new_value the value to be set -@@ -763,7 +763,7 @@ JSON_EXPORT int64_t json_object_get_int64(const struct json_object *obj); - * - * The type of obj is checked to be a json_type_int and 0 is returned - * if it is not without any further actions. If type of obj is json_type_int -- * the obect value is chaned to new_value -+ * the object value is changed to new_value - * - * @param obj the json_object instance - * @param new_value the value to be set -@@ -880,7 +880,7 @@ JSON_EXPORT double json_object_get_double(const struct json_object *obj); - * - * The type of obj is checked to be a json_type_double and 0 is returned - * if it is not without any further actions. If type of obj is json_type_double -- * the obect value is chaned to new_value -+ * the object value is changed to new_value - * - * @param obj the json_object instance - * @param new_value the value to be set -@@ -942,10 +942,10 @@ JSON_EXPORT int json_object_set_string(json_object* obj, const char* new_value); - * - * The type of obj is checked to be a json_type_string and 0 is returned - * if it is not without any further actions. If type of obj is json_type_string -- * the obect value is chaned to new_value -+ * the object value is changed to new_value - * - * @param obj the json_object instance -- * @param new_value the value to be set; Since string legth is given in len this need not be zero terminated -+ * @param new_value the value to be set; Since string length is given in len this need not be zero terminated - * @param len the length of new_value - * @returns 1 if value is set correctly, 0 otherwise - */ -diff --git a/json_pointer.c b/json_pointer.c -index c7e34f76f3..9531c036c8 100644 ---- a/json_pointer.c -+++ b/json_pointer.c -@@ -28,7 +28,7 @@ - static void string_replace_all_occurrences_with_char(char *s, const char *occur, char repl_char) - { - int slen = strlen(s); -- int skip = strlen(occur) - 1; /* length of the occurence, minus the char we're replacing */ -+ int skip = strlen(occur) - 1; /* length of the occurrence, minus the char we're replacing */ - char *p = s; - while ((p = strstr(p, occur))) { - *p = repl_char; -diff --git a/tests/test_compare.c b/tests/test_compare.c -index c7e44f6ea6..cba328cf4b 100644 ---- a/tests/test_compare.c -+++ b/tests/test_compare.c -@@ -18,19 +18,19 @@ int main() - struct json_object *int3 = json_object_new_int(1); - - if (!json_object_equal(int1, int2)) -- printf("JSON integer comparision is correct\n"); -+ printf("JSON integer comparison is correct\n"); - else -- printf("JSON integer comparision failed\n"); -+ printf("JSON integer comparison failed\n"); - - if (json_object_equal(int1, int1)) -- printf("JSON same object comparision is correct\n"); -+ printf("JSON same object comparison is correct\n"); - else -- printf("JSON same object comparision failed\n"); -+ printf("JSON same object comparison failed\n"); - - if (json_object_equal(int2, int3)) -- printf("JSON same integer comparision is correct\n"); -+ printf("JSON same integer comparison is correct\n"); - else -- printf("JSON same integer comparision failed\n"); -+ printf("JSON same integer comparison failed\n"); - - json_object_put(int1); - json_object_put(int2); -diff --git a/tests/test_compare.expected b/tests/test_compare.expected -index 46f03c4101..5468f83d2e 100644 ---- a/tests/test_compare.expected -+++ b/tests/test_compare.expected -@@ -1,6 +1,6 @@ --JSON integer comparision is correct --JSON same object comparision is correct --JSON same integer comparision is correct -+JSON integer comparison is correct -+JSON same object comparison is correct -+JSON same integer comparison is correct - Comparing equal strings is correct - Comparing different strings is correct - Comparing equal doubles is correct diff --git a/json-c-0.13.1-parse_test_UTF8_BOM.patch b/json-c-0.13.1-parse_test_UTF8_BOM.patch deleted file mode 100644 index a8e047d39ee9b0cb5e08cba9eab4ca758ba2bf3e..0000000000000000000000000000000000000000 --- a/json-c-0.13.1-parse_test_UTF8_BOM.patch +++ /dev/null @@ -1,75 +0,0 @@ -From da4b34355da023c439e96bc6ca31886cd69d6bdb Mon Sep 17 00:00:00 2001 -From: Eric Haszlakiewicz -Date: Sun, 25 Mar 2018 18:23:42 -0400 -Subject: [PATCH] Add an parse test for content starting with a UTF8 BOM, which - is _not_ a valid start to a JSON message. - ---- - tests/test_parse.c | 16 +++++++++++++++- - tests/test_parse.expected | 5 ++++- - 2 files changed, 19 insertions(+), 2 deletions(-) - -diff --git a/tests/test_parse.c b/tests/test_parse.c -index ee1f8387b3..f46651b0a1 100644 ---- a/tests/test_parse.c -+++ b/tests/test_parse.c -@@ -9,6 +9,7 @@ - #include "json_visit.h" - - static void test_basic_parse(void); -+static void test_utf8_parse(void); - static void test_verbose_parse(void); - static void test_incremental_parse(void); - -@@ -19,6 +20,8 @@ int main(void) - static const char separator[] = "=================================="; - test_basic_parse(); - puts(separator); -+ test_utf8_parse(); -+ puts(separator); - test_verbose_parse(); - puts(separator); - test_incremental_parse(); -@@ -107,6 +110,17 @@ static void test_basic_parse() - single_basic_parse("[18446744073709551616]", 1); - } - -+static void test_utf8_parse() -+{ -+ // json_tokener_parse doesn't support checking for byte order marks. -+ // It's the responsibility of the caller to detect and skip a BOM. -+ // Both of these checks return null. -+ char utf8_bom[] = { 0xEF, 0xBB, 0xBF, 0x00 }; -+ char utf8_bom_and_chars[] = { 0xEF, 0xBB, 0xBF, '{', '}', 0x00 }; -+ single_basic_parse(utf8_bom, 0); -+ single_basic_parse(utf8_bom_and_chars, 0); -+} -+ - // Clear the re-serialization information that the tokener - // saves to ensure that the output reflects the actual - // values we parsed, rather than just the original input. -@@ -145,7 +159,7 @@ static void test_verbose_parse() - /* b/c the string starts with 'f' parsing return a boolean error */ - assert (error == json_tokener_error_parse_boolean); - -- puts("json_tokener_parse_versbose() OK"); -+ puts("json_tokener_parse_verbose() OK"); - } - - struct incremental_step { -diff --git a/tests/test_parse.expected b/tests/test_parse.expected -index ada61411fe..5d3976a745 100644 ---- a/tests/test_parse.expected -+++ b/tests/test_parse.expected -@@ -51,7 +51,10 @@ new_obj.to_string([0e+])=[ 0.0 ] - new_obj.to_string([0e+-1])=null - new_obj.to_string([18446744073709551616])=[ 9223372036854775807 ] - ================================== --json_tokener_parse_versbose() OK -+new_obj.to_string()=null -+new_obj.to_string({})=null -+================================== -+json_tokener_parse_verbose() OK - ================================== - Starting incremental tests. - Note: quotes and backslashes seen in the output here are literal values passed diff --git a/json-c-0.15-20200726.tar.gz b/json-c-0.15-20200726.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..c7756acc1e117704cb5e1d56e1362223e9ca144b Binary files /dev/null and b/json-c-0.15-20200726.tar.gz differ diff --git a/json-c-bugfix-against-INT64_MAX.patch b/json-c-bugfix-against-INT64_MAX.patch deleted file mode 100644 index d57332477c0071f4882f607ac3879773412b8445..0000000000000000000000000000000000000000 --- a/json-c-bugfix-against-INT64_MAX.patch +++ /dev/null @@ -1,29 +0,0 @@ -From d0b87ee87b282e9b91a1af924050e217b0b2ae8b Mon Sep 17 00:00:00 2001 -From: Eric Haszlakiewicz -Date: Mon, 12 Aug 2019 00:30:45 +0000 -Subject: [PATCH] Add an explicit cast to double to squash a - -Wimplicit-int-float-conversion warning. Though we will no longer be - comparing exactly against INT64_MAX, this is ok because any value of that - magnitude stored in a double will *also* have been rounded up, so the - comparison will work appropriately. - ---- - json_object.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/json_object.c b/json_object.c -index 026dab313b..192919f460 100644 ---- a/json_object.c -+++ b/json_object.c -@@ -701,7 +701,9 @@ int64_t json_object_get_int64(const struct json_object *jso) - case json_type_int: - return jso->o.c_int64; - case json_type_double: -- if (jso->o.c_double >= INT64_MAX) -+ // INT64_MAX can't be exactly represented as a double -+ // so cast to tell the compiler it's ok to round up. -+ if (jso->o.c_double >= (double)INT64_MAX) - return INT64_MAX; - if (jso->o.c_double <= INT64_MIN) - return INT64_MIN; - diff --git a/json-c.spec b/json-c.spec index 231a57702fb42c5394c0a8335b08e0fe3af2abd2..57f21502dd805a9b84851d444edebb0acf95d5f4 100644 --- a/json-c.spec +++ b/json-c.spec @@ -1,35 +1,19 @@ %{!?_pkgdocdir:%global _pkgdocdir %{_docdir}/%{name}-%{version}} -%global so_ver 4 -%global reldate 20180305 +%global so_ver 5 +%global reldate 20200726 Name: json-c -Version: 0.13.1 -Release: 9 +Version: 0.15 +Release: 1 Summary: JSON implementation in C License: MIT URL: https://github.com/%{name}/%{name} Source0: %{url}/archive/%{name}-%{version}-%{reldate}.tar.gz -# Cherry-picked from upstream. -Patch0: json-c-0.13.1-parse_test_UTF8_BOM.patch -Patch1: json-c-0.13.1-fix_incorrect_casts_in_calls_to_ctype_functions.patch -Patch2: json-c-0.13.1-fix_typos.patch - -Patch6000: 0012-json_object_private-Use-unsigned-32-bit-integer-type.patch -Patch6001: 0040-Fixed-misalignment-in-JSON-string-due-to-space-after.patch -Patch6002: 0048-json_object.c-set-errno-in-json_object_get_double.patch -Patch6003: 0053-Fix-compiler-warnings.patch -Patch6004: 0002-Issue-486-append-a-missing-.0-to-negative-double-val.patch - -Patch9000: bugfix-json-c-support_aarch64.patch -Patch6005: json-c-bugfix-against-INT64_MAX.patch -Patch6006: CVE-2020-12762.patch -Patch6007: backport-Detect-broken-RDRAND-during-initialization.patch -Patch6008: backport-drop-the-rdrand-test-loops.patch -BuildRequires: libtool +BuildRequires: cmake gcc ninja-build json-c %description JSON-C implements a reference counting object model that allows you @@ -60,51 +44,51 @@ Obsoletes: %{name}-doc = %{version}-%{release} This package contains the reference manual for %{name}. %prep -%autosetup -Tb 0 -n %{name}-%{name}-%{version}-%{reldate} -p 1 - -for doc in ChangeLog; do - %{_bindir}/iconv -f iso-8859-1 -t utf8 ${doc} > ${doc}.new - /bin/touch -r ${doc} ${doc}.new - %{__mv} -f ${doc}.new ${doc} -done - -%{__sed} -i -e 's!#ACLOCAL_AMFLAGS!ACLOCAL_AMFLAGS!g' Makefile.am -%{_bindir}/autoreconf -fiv - - +%autosetup -n %{name}-%{name}-%{version}-%{reldate} -p 1 + +# Remove pre-built html documentation. +rm -fr doc/html + +# Update Doxyfile. +doxygen -s -u doc/Doxyfile.in + + %build -%configure --disable-silent-rules --disable-static --enable-rdrand \ - --enable-shared --enable-threading - -%make_build - -%{_bindir}/doxygen Doxyfile - +%cmake \ + -DBUILD_STATIC_LIBS:BOOL=OFF \ + -DCMAKE_BUILD_TYPE:STRING=RELEASE \ + -DCMAKE_C_FLAGS_RELEASE:STRING="" \ + -DDISABLE_BSYMBOLIC:BOOL=OFF \ + -DDISABLE_WERROR:BOOL=ON \ + -DENABLE_RDRAND:BOOL=ON \ + -DENABLE_THREADING:BOOL=ON \ + -G Ninja\ + %{!?__cmake_in_source_build:-S "%{_vpath_srcdir}"} \ + %{!?__cmake_in_source_build:-B "%{_vpath_builddir}"} \ + +%__cmake --build "%{_vpath_builddir}" %{?_smp_mflags} --verbose --target all doc +#%cmake_build + %install -%make_install +#%cmake_install +DESTDIR="%{buildroot}" %__cmake --install "%{_vpath_builddir}" -%delete_la_and_a +cp -a %{_libdir}/libjson-c.so.4 $RPM_BUILD_ROOT%{_libdir} +cp -a %{_libdir}/libjson-c.so.4.0.0 $RPM_BUILD_ROOT%{_libdir} -%{__mkdir} -p %{buildroot}%{_pkgdocdir} -%{__cp} -pr doc/html ChangeLog README README.* %{buildroot}%{_pkgdocdir} -hardlink -cvf %{buildroot}%{_pkgdocdir} - - -%pretrans devel -p -path = "%{_includedir}/%{name}" -st = posix.stat(path) -if st and st.type == "link" then - os.remove(path) -end +mkdir -p %{buildroot}%{_pkgdocdir} +hardlink -cfv %{buildroot}%{_pkgdocdir} %ldconfig_scriptlets %files %license AUTHORS COPYING %{_libdir}/lib%{name}.so.%{so_ver}* +%{_libdir}/libjson-c.so.4* %files devel %{_includedir}/%{name}/ +%{_libdir}/cmake/%{name} %{_libdir}/lib%{name}.so %{_libdir}/pkgconfig/%{name}.pc @@ -112,13 +96,16 @@ end %doc %{_pkgdocdir} %changelog +* Tue Sep 14 2021 hanhui - 0.15-1 +- update to 0.15 + * Thu Sep 9 2021 liuyumeng - 0.13.1-9 - fix broken RDRAND causes infinite looping * Tue Jul 21 2020 wangye - 0.13.1-8 - fix hardlink path -* Fri May 22 2020 ruanweidong - 0.13.1-7 +* Fri May 22 2020 ruanweidong -0.13.1-7 - fix CVE-2020-12762 * Sat Mar 21 2020 songnannan - 0.13.1-6