Skip to content

dump_string func can error return  #655

@Dennis-Kang

Description

@Dennis-Kang

callstack

jsonp_malloc
strbuffer_append_bytes
dump_to_strbuffer
dump_string
do_dump
json_dump_callback
json_dumps

if malloc func return null then dump_string func return -1.

but, do_dump func not check return value.

dump.c

                    dump_string(key->key, key->len, dump, data, flags);
                    if (dump(separator, separator_length, data) ||
                        do_dump(value, flags, depth + 1, parents, dump, data)) {
                        jsonp_free(keys);
                        return -1;
                    }

json_dumps func return invalid value

{"id": 59, ": "test", "col3": 0}  column blank..

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