Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dump_string func can error return #655

Open
Dennis-Kang opened this issue Jul 6, 2023 · 1 comment
Open

dump_string func can error return #655

Dennis-Kang opened this issue Jul 6, 2023 · 1 comment

Comments

@Dennis-Kang
Copy link

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..
@Dennis-Kang
Copy link
Author

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

No branches or pull requests

1 participant