1
0
mirror of https://github.com/systemd/systemd.git synced 2025-08-25 13:49:55 +03:00

fuzz-unit-file: skip BOM (#8723)

Yet another false positive from ListenNetlink,
https://oss-fuzz.com/v2/testcase-detail/4908210742886400/7694.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2018-04-16 10:59:41 +02:00
committed by Lennart Poettering
parent 20f978643f
commit d6ea3b78a6

View File

@ -8,6 +8,7 @@
#include "load-fragment.h"
#include "string-util.h"
#include "unit.h"
#include "utf8.h"
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
_cleanup_free_ char *out = NULL; /* out should be freed after g */
@ -46,7 +47,8 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
if (read_line(f, LONG_LINE_MAX, &l) <= 0)
break;
ll = l + strspn(l, WHITESPACE);
ll = startswith(l, UTF8_BYTE_ORDER_MARK) ?: l;
ll = ll + strspn(ll, WHITESPACE);
if (HAS_FEATURE_MEMORY_SANITIZER && startswith(ll, "ListenNetlink")) {
/* ListenNetlink causes a false positive in msan,