json: add flags parameter to json_parse_file(), for parsing "sensitive" data

This will call json_variant_sensitive() internally while parsing for
each allocated sub-variant. This is better than calling it a posteriori
at the end, because partially parsed variants will always be properly
erased from memory this way.
This commit is contained in:
Lennart Poettering
2019-12-02 09:47:00 +01:00
parent f325aaf341
commit d642f640bf
6 changed files with 32 additions and 21 deletions
+1 -1
View File
@@ -18,7 +18,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
f = fmemopen_unlocked((char*) data, size, "re");
assert_se(f);
if (json_parse_file(f, NULL, &v, NULL, NULL) < 0)
if (json_parse_file(f, NULL, 0, &v, NULL, NULL) < 0)
return 0;
g = open_memstream_unlocked(&out, &out_size);