Files
cJSON/tests
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
..
2017-11-04 21:19:15 +08:00
2018-10-11 00:30:43 +02:00
2020-04-02 16:24:10 +08:00
2020-03-18 16:04:58 +08:00
2019-11-28 09:56:04 +08:00