]> git.ipfire.org Git - thirdparty/json-c.git/commit
json_object_from_fd_ex: fail if file is too large 757/head
authorTobias Stoeckmann <tobias@stoeckmann.org>
Sun, 20 Mar 2022 12:17:37 +0000 (13:17 +0100)
committerTobias Stoeckmann <tobias@stoeckmann.org>
Sun, 20 Mar 2022 12:17:37 +0000 (13:17 +0100)
commit5accae04bbc727fd447c2db4c1c541a4142bd4a0
tree590d0e44376462ab23ab3800e1ed67968634ff61
parent79459b2de2598fb0c03aa9615e168016b8fb69d3
json_object_from_fd_ex: fail if file is too large

If the input file is too large to fit into a printbuf then return an
error value instead of silently truncating the parsed content.

This introduces errno handling into printbuf to distinguish between an
input file being too large and running out of memory.
json_util.c
printbuf.c
tests/test_util_file.expected