glib/fuzzing/fuzz_uri_parse_params.c
Philip Withnall dd11160f7f fuzzing: Add fuzz tests for GUri parsing and escaping
Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: #110
2020-06-25 13:57:35 +04:00

21 lines
380 B
C

#include "fuzz.h"
int
LLVMFuzzerTestOneInput (const unsigned char *data, size_t size)
{
GHashTable *parsed_params = NULL;
fuzz_set_logging_func ();
if (size > G_MAXSSIZE)
return 0;
parsed_params = g_uri_parse_params ((const gchar *) data, (gssize) size, '&', FALSE);
if (parsed_params == NULL)
return 0;
g_hash_table_unref (parsed_params);
return 0;
}