Mercurial > dropbear
comparison fuzz-wrapfd.c @ 1377:d4cc85e6c569 fuzz
rearrange, all fuzzers now call fuzzer_set_input()
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Thu, 25 May 2017 22:21:49 +0800 |
parents | 16f45f2df38f |
children | 4b864fd12b22 |
comparison
equal
deleted
inserted
replaced
1376:9e9c8d37fd56 | 1377:d4cc85e6c569 |
---|---|
24 // for quick selection of in-use descriptors | 24 // for quick selection of in-use descriptors |
25 static int wrap_used[IOWRAP_MAXFD+1]; | 25 static int wrap_used[IOWRAP_MAXFD+1]; |
26 static unsigned int nused; | 26 static unsigned int nused; |
27 static unsigned short rand_state[3]; | 27 static unsigned short rand_state[3]; |
28 | 28 |
29 void wrapfd_setup(uint32_t seed) { | 29 void wrapfd_setup() { |
30 TRACE(("wrapfd_setup %x", seed)) | 30 TRACE(("wrapfd_setup %x", seed)) |
31 nused = 0; | 31 nused = 0; |
32 memset(wrap_fds, 0x0, sizeof(wrap_fds)); | 32 memset(wrap_fds, 0x0, sizeof(wrap_fds)); |
33 memset(wrap_used, 0x0, sizeof(wrap_used)); | 33 memset(wrap_used, 0x0, sizeof(wrap_used)); |
34 | 34 |
35 memset(rand_state, 0x0, sizeof(rand_state)); | 35 memset(rand_state, 0x0, sizeof(rand_state)); |
36 wrapfd_setseed(50); | |
37 } | |
38 | |
39 void wrapfd_setseed(uint32_t seed) { | |
36 *((uint32_t*)rand_state) = seed; | 40 *((uint32_t*)rand_state) = seed; |
37 nrand48(rand_state); | 41 nrand48(rand_state); |
38 } | 42 } |
39 | 43 |
40 void wrapfd_add(int fd, buffer *buf, enum wrapfd_mode mode) { | 44 void wrapfd_add(int fd, buffer *buf, enum wrapfd_mode mode) { |