Просмотр исходного кода

Release 1.7.17

update version to 1.7.17
Alanscut 2 лет назад
Родитель
Сommit
92b12393c1
3 измененных файлов с 13 добавлено и 1 удалено
  1. 7 0
      CHANGELOG.md
  2. 5 0
      cJSON.c
  3. 1 1
      cJSON.h

+ 7 - 0
CHANGELOG.md

@@ -1,3 +1,10 @@
+1.7.17 (Dec 26, 2023)
+======
+Fixes:
+------
+* Fix null reference in cJSON_SetValuestring(CVE-2023-50472), see #809
+* Fix null reference in cJSON_InsertItemInArray(CVE-2023-50471), see #809 and #810
+
 1.7.16 (Jul 5, 2023)
 ======
 Features:

+ 5 - 0
cJSON.c

@@ -117,6 +117,11 @@ CJSON_PUBLIC(double) cJSON_GetNumberValue(const cJSON * const item)
     return item->valuedouble;
 }
 
+/* This is a safeguard to prevent copy-pasters from using incompatible C and header files */
+#if (CJSON_VERSION_MAJOR != 1) || (CJSON_VERSION_MINOR != 7) || (CJSON_VERSION_PATCH != 17)
+    #error cJSON.h and cJSON.c have different versions. Make sure that both have the same.
+#endif
+
 CJSON_PUBLIC(const char*) cJSON_Version(void)
 {
     static char version[15];

+ 1 - 1
cJSON.h

@@ -81,7 +81,7 @@ then using the CJSON_API_VISIBILITY flag to "export" the same symbols the way CJ
 /* project version */
 #define CJSON_VERSION_MAJOR 1
 #define CJSON_VERSION_MINOR 7
-#define CJSON_VERSION_PATCH 16
+#define CJSON_VERSION_PATCH 17
 
 #include <stddef.h>