summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2019-02-25 12:02:17 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2019-02-25 12:35:51 +0900
commit7cd1f60df0608597e954508b371b42df37d2e9c8 (patch)
tree87c314411106c6a30edea229f4a548ed97351899
parent84fb56d396b14fb778dbe51f02d247f0899a74ef (diff)
downloadsystemd-7cd1f60df0608597e954508b371b42df37d2e9c8.tar.gz
fuzz: use fflush() and drop unnecessary rewind()
-rw-r--r--src/network/fuzz-netdev-parser.c2
-rw-r--r--src/network/fuzz-network-parser.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/network/fuzz-netdev-parser.c b/src/network/fuzz-netdev-parser.c
index 37f7cf8ccd..78c8d0c2b5 100644
--- a/src/network/fuzz-netdev-parser.c
+++ b/src/network/fuzz-netdev-parser.c
@@ -18,7 +18,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
if (size != 0)
assert_se(fwrite(data, size, 1, f) == 1);
- rewind(f);
+ fflush(f);
assert_se(manager_new(&manager) >= 0);
(void) netdev_load_one(manager, netdev_config);
return 0;
diff --git a/src/network/fuzz-network-parser.c b/src/network/fuzz-network-parser.c
index 4b79500805..e4b789c167 100644
--- a/src/network/fuzz-network-parser.c
+++ b/src/network/fuzz-network-parser.c
@@ -18,7 +18,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
if (size != 0)
assert_se(fwrite(data, size, 1, f) == 1);
- rewind(f);
+ fflush(f);
assert_se(manager_new(&manager) >= 0);
(void) network_load_one(manager, network_config);
return 0;