rearrange, all fuzzers now call fuzzer_set_input()

--HG--
branch : fuzz
This commit is contained in:
Matt Johnston
2017-05-25 22:21:49 +08:00
parent 095b067857
commit b8fa712847
6 changed files with 39 additions and 38 deletions

View File

@@ -19,6 +19,23 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
return 0;
}
// get prefix. input format is
// string prefix
// uint32 wrapfd seed
// ... to be extended later
// [bytes] ssh input stream
// be careful to avoid triggering buffer.c assertions
if (fuzz.input->len < 8) {
return 0;
}
size_t prefix_size = buf_getint(fuzz.input);
if (prefix_size != 4) {
return 0;
}
uint32_t wrapseed = buf_getint(fuzz.input);
wrapfd_setseed(wrapseed);
int fakesock = 1;
wrapfd_add(fakesock, fuzz.input, PLAIN);