mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 18:11:28 +01:00
4f2ae48c54
A small one just to check that we don't crash nor go out of bounds! Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
21 lines
421 B
C
21 lines
421 B
C
#include <tests/fuzz/libfuzz.h>
|
|
|
|
#include <ccan/tal/tal.h>
|
|
#include <common/descriptor_checksum.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);
|
|
}
|