Skip to content

heap-buffer-overflow at json_value_parse #7

Closed
@NotmebutWind

Description

@NotmebutWind

CC=gcc -fsanitize=address make
test.c:
char* jstr = "{ "";
json_value_t *val = json_value_parse(jstr);

use json_value_parse to parse input "{ "" will cause a heap-buffer-overflow error.

==2352670==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x602000109953 at pc 0x55900a20cc38 bp 0x7ffd112d2dc0 sp 0x7ffd112d2db0
READ of size 1 at 0x602000109953 thread T0
#0 0x55900a20cc37 in json_value_parse /opt1/software/json-parser/json_parser.c:685
#1 0x55900a213a4f in main /opt1/software/json-parser/test.c:184

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