diff options
author | Colin Watson <cjwatson@debian.org> | 2020-04-17 20:57:34 +0100 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2020-04-18 09:48:21 +0100 |
commit | df7226c4b684fd229dc046388225c69ded877721 (patch) | |
tree | e69014e1ee868c4ec178b8a36baae7de31786beb /fuzz/mutator_aux.c | |
parent | f794345c2d734f593da8ed7754e5dbb5809c688d (diff) | |
parent | 75073d0a8478441cc97a6efa10b566c5fb1dac81 (diff) |
Update upstream source from tag 'upstream/1.4.0'
Update to upstream version '1.4.0'
with Debian dir 64889867df57bd13ea0cb964223697d378d391ce
Diffstat (limited to 'fuzz/mutator_aux.c')
-rw-r--r-- | fuzz/mutator_aux.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/fuzz/mutator_aux.c b/fuzz/mutator_aux.c index 24aa716..fe09438 100644 --- a/fuzz/mutator_aux.c +++ b/fuzz/mutator_aux.c | |||
@@ -37,6 +37,12 @@ consume(const void *body, size_t len) | |||
37 | x ^= *ptr++; | 37 | x ^= *ptr++; |
38 | } | 38 | } |
39 | 39 | ||
40 | void | ||
41 | consume_str(const char *str) | ||
42 | { | ||
43 | consume(str, strlen(str)); | ||
44 | } | ||
45 | |||
40 | int | 46 | int |
41 | unpack_int(uint8_t t, uint8_t **ptr, size_t *len, int *v) NO_MSAN | 47 | unpack_int(uint8_t t, uint8_t **ptr, size_t *len, int *v) NO_MSAN |
42 | { | 48 | { |
@@ -227,6 +233,30 @@ pack_blob(uint8_t t, uint8_t **ptr, size_t *len, const struct blob *v) NO_MSAN | |||
227 | return (0); | 233 | return (0); |
228 | } | 234 | } |
229 | 235 | ||
236 | size_t | ||
237 | len_int(void) | ||
238 | { | ||
239 | return (sizeof(uint8_t) + sizeof(size_t) + sizeof(int)); | ||
240 | } | ||
241 | |||
242 | size_t | ||
243 | len_string(int max) | ||
244 | { | ||
245 | return ((sizeof(uint8_t) + sizeof(size_t)) + (max ? MAXSTR - 1 : 0)); | ||
246 | } | ||
247 | |||
248 | size_t | ||
249 | len_byte(void) | ||
250 | { | ||
251 | return (sizeof(uint8_t) + sizeof(size_t) + sizeof(uint8_t)); | ||
252 | } | ||
253 | |||
254 | size_t | ||
255 | len_blob(int max) | ||
256 | { | ||
257 | return (sizeof(uint8_t) + sizeof(size_t) + (max ? MAXBLOB : 0)); | ||
258 | } | ||
259 | |||
230 | void | 260 | void |
231 | mutate_byte(uint8_t *b) | 261 | mutate_byte(uint8_t *b) |
232 | { | 262 | { |