From: Yu Watanabe Date: Thu, 28 Feb 2019 05:02:33 +0000 (+0900) Subject: fuzz: do not assume the existence of /sys/class/net/lo X-Git-Tag: v242-rc1~230 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=358fb6862bf141f48965b130289ddbcd96400e61;p=thirdparty%2Fsystemd.git fuzz: do not assume the existence of /sys/class/net/lo Hopefully fixes oss-fuzz#13440. --- 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; }