summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Hanselmann <public@hansmi.ch>2021-07-08 22:49:49 +0200
committerMichael Hanselmann <public@hansmi.ch>2021-07-08 23:18:14 +0200
commit104eca8ff3360d332ed396abe531ea623d8f26f4 (patch)
treea690d327d31a5e2de82ebe5f5274b72379183287
parent171c4e1f5a43cf6cfbfa8ace8fdb62ad98f9190d (diff)
usbredirparserfuzz: Add "no hello" flag to possibilities
The `usbredirparser_fl_no_hello` flag can also be tested in the fuzzer. Signed-off-by: Michael Hanselmann <public@hansmi.ch>
-rw-r--r--fuzzing/usbredirparserfuzz.cc7
1 files changed, 2 insertions, 5 deletions
diff --git a/fuzzing/usbredirparserfuzz.cc b/fuzzing/usbredirparserfuzz.cc
index 5509d65..ec64336 100644
--- a/fuzzing/usbredirparserfuzz.cc
+++ b/fuzzing/usbredirparserfuzz.cc
@@ -420,11 +420,8 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
cap = fdp->ConsumeIntegral<decltype(caps)::value_type>();
}
- int init_flags = 0;
-
- if (fdp->ConsumeBool()) {
- init_flags |= usbredirparser_fl_usb_host;
- }
+ const int init_flags = fdp->ConsumeIntegral<uint8_t>() &
+ (usbredirparser_fl_usb_host | usbredirparser_fl_no_hello);
usbredirparser_init(parser.get(), "fuzzer", caps.data(), caps.size(),
init_flags);