From 358fb6862bf141f48965b130289ddbcd96400e61 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 28 Feb 2019 14:02:33 +0900 Subject: [PATCH] fuzz: do not assume the existence of /sys/class/net/lo Hopefully fixes oss-fuzz#13440. --- src/fuzz/fuzz-udev-database.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/fuzz/fuzz-udev-database.c b/src/fuzz/fuzz-udev-database.c index d592d23c9e4..9d7c0fa3e12 100644 --- a/src/fuzz/fuzz-udev-database.c +++ b/src/fuzz/fuzz-udev-database.c @@ -1,5 +1,6 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ +#include "device-internal.h" #include "device-private.h" #include "fd-util.h" #include "fs-util.h" @@ -19,7 +20,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { assert_se(fwrite(data, size, 1, f) == 1); fflush(f); - assert_se(sd_device_new_from_syspath(&dev, "/sys/class/net/lo") >= 0); + assert_se(device_new_aux(&dev) >= 0); (void) device_read_db_internal_filename(dev, filename); return 0; }