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:
@@ -2214,7 +2214,7 @@ int oci_load(FILE *f, const char *bundle, Settings **ret) {
|
||||
|
||||
path = strjoina(bundle, "/config.json");
|
||||
|
||||
r = json_parse_file(f, path, &oci, &line, &column);
|
||||
r = json_parse_file(f, path, 0, &oci, &line, &column);
|
||||
if (r < 0) {
|
||||
if (line != 0 && column != 0)
|
||||
return log_error_errno(r, "Failed to parse '%s' at %u:%u: %m", path, line, column);
|
||||
|
||||
Reference in New Issue
Block a user