Commit Graph
7 Commits
Author SHA1 Message Date
Lee b2890c8d76 fix: prevent NULL pointer dereference in cJSON_SetNumberHelper (#991)
Add NULL check at the beginning of cJSON_SetNumberHelper to prevent
segmentation fault when called with NULL object pointer. The function
now returns NAN (Not-a-Number) when object is NULL, consistent with
error handling patterns in other cJSON functions.

This fixes a Denial of Service vulnerability (CWE-476) where an
attacker could crash applications using the cJSON library by
triggering this function with a NULL pointer.

Changes:
- cJSON.c: Add NULL check in cJSON_SetNumberHelper
- tests/misc_tests.c: Add test case and math.h include

Security: Fixes NULL pointer dereference vulnerability
2026-03-12 19:18:36 +08:00
Lee a3f3d6c784 docs: fix outdated CMake version requirement in README (#990)
The README stated that CMake 2.8.5+ was required, but CMakeLists.txt
requires CMake 3.5+. This inconsistency caused confusion for users
with CMake versions between 2.8.5 and 3.5.

Also updated library_config/uninstall.cmake to match for consistency.

Fixes #988
2026-03-12 19:18:15 +08:00
Lee a29814f285 upgrade version of cmake_minimum_required (#986)
github actions fix
2026-02-07 17:13:51 +08:00
Lee 74e1ff4994 fix the incorrect check in decode_array_index_from_pointer (#957)
this fixes CVE-2025-57052
2025-09-05 14:53:20 +08:00
PeterAlfredLee 8f2beb57dd bump version of actions/upload-artifact 2025-05-07 11:31:28 +08:00
PeterAlfredLee a328d65ad4 allocate memory for the temporary buffer
Allocate memory for the temporary buffer when paring numbers.
This fixes CVE-2023-26819
2025-05-07 11:31:28 +08:00
Lee f66cbab4bf fix error in null checkings (#810)
fixes #802 and #803
2023-12-20 11:05:23 +08:00