Skip to content

Fix dump_string func return value check#649

Open
devil-k wants to merge 1 commit intoakheron:masterfrom
devil-k:master
Open

Fix dump_string func return value check#649
devil-k wants to merge 1 commit intoakheron:masterfrom
devil-k:master

Conversation

@devil-k
Copy link

@devil-k devil-k commented May 12, 2023

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..

changes

do_dump func check return value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant