diff options
Diffstat (limited to 'src/test/fuzz/fuzz_descriptor.c')
-rw-r--r-- | src/test/fuzz/fuzz_descriptor.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/test/fuzz/fuzz_descriptor.c b/src/test/fuzz/fuzz_descriptor.c new file mode 100644 index 0000000000..1364bf4291 --- /dev/null +++ b/src/test/fuzz/fuzz_descriptor.c @@ -0,0 +1,26 @@ + +#include "or.h" +#include "routerparse.h" +#include "routerlist.h" +#include "fuzzing.h" + +int +fuzz_init(void) +{ + ed25519_init(); + return 0; +} + +int +fuzz_main(const uint8_t *data, size_t sz) +{ + routerinfo_t *ri; + const char *str = (const char*) data; + ri = router_parse_entry_from_string((const char *)str, + str+sz, + 0, 0, 0, NULL); + if (ri) + routerinfo_free(ri); + return 0; +} + |