diff options
author | Lennart Poettering <lennart@poettering.net> | 2018-12-15 12:25:32 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-12-17 09:14:23 +0100 |
commit | 2d78717b09d05b9a9164cb118fb89924570a5e61 (patch) | |
tree | a81909ccd5c243c85ae6a49aa2c27f970d580b9b /src/test/test-json.c | |
parent | NEWS: mention DynamicTransmitLoadBalancing= (diff) | |
download | systemd-2d78717b09d05b9a9164cb118fb89924570a5e61.tar.xz systemd-2d78717b09d05b9a9164cb118fb89924570a5e61.zip |
fileio: when reading a full file into memory, refuse inner NUL bytes
Just some extra care to avoid any ambiguities in what we read.
Diffstat (limited to 'src/test/test-json.c')
-rw-r--r-- | src/test/test-json.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/test/test-json.c b/src/test/test-json.c index d3ece0bc0b..5aa4d19dbe 100644 --- a/src/test/test-json.c +++ b/src/test/test-json.c @@ -358,7 +358,7 @@ static void test_source(void) { "%s" "--- original end ---\n", data); - assert_se(f = fmemopen((void*) data, sizeof(data), "r")); + assert_se(f = fmemopen((void*) data, strlen(data), "r")); assert_se(json_parse_file(f, "waldo", &v, NULL, NULL) >= 0); |