Skip to content

An 'outside the range of int' bug found in cJSON_CreateNumber #806

@PromptFuzz

Description

@PromptFuzz

Hi,
UBSAN reported an error in cJSON_CreateNumber.

/cjson/src/cjson/cJSON.c:2448:30: runtime error: nan is outside the range of representable values of type 'int'
   #0 0x55ab38f2da64 in cJSON_CreateNumber /cjson/src/cjson/cJSON.c:2448:30
   #1 0x55ab38f2d64c in cJSON_AddNumberToObject /cjson/src/cjson/cJSON.c:2129:26
   #2 0x55ab38f1f0d1 in LLVMFuzzerTestOneInput /poc.cc:42:13

PoC
poc.tar.gz

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions