fuzz-unit-file: fix check if ListenNetlink is used

A line may contain leading spaces which we should skip.
Fixes https://oss-fuzz.com/v2/issue/5546208027213824/7049.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2018-03-21 13:16:25 +01:00
parent 8a37ce6545
commit af3865abf1

View file

@ -41,11 +41,14 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
for (;;) {
_cleanup_free_ char *l = NULL;
const char *ll;
if (read_line(f, LINE_MAX, &l) <= 0)
break;
if (startswith(l, "ListenNetlink="))
ll = l + strspn(l, WHITESPACE);
if (startswith(ll, "ListenNetlink="))
/* ListenNetlink causes a false positive in msan,
* let's skip this for now. */
return 0;