core-lightning/tests/fuzz/fuzz-descriptor_checksum.c
Rusty Russell 5787e18e69 fuzz: fix check-src/includes when fuzzing enabled.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-04-05 06:12:24 +09:30

21 lines
415 B
C

#include "config.h"
#include <common/descriptor_checksum.h>
#include <tests/fuzz/libfuzz.h>
void init(int *argc, char ***argv)
{
}
void run(const uint8_t *data, size_t size)
{
char *string;
struct descriptor_checksum checksum;
/* We should not crash nor overflow the checksum buffer. */
string = to_string(NULL, data, size);
descriptor_checksum(string, tal_count(string), &checksum);
tal_free(string);
}