2020-06-19 12:54:41 +02:00
|
|
|
#include "fuzz.h"
|
|
|
|
|
|
|
|
int
|
|
|
|
LLVMFuzzerTestOneInput (const unsigned char *data, size_t size)
|
|
|
|
{
|
2020-07-06 17:38:40 +02:00
|
|
|
GError *error = NULL;
|
2020-06-19 12:54:41 +02:00
|
|
|
GHashTable *parsed_params = NULL;
|
|
|
|
|
|
|
|
fuzz_set_logging_func ();
|
|
|
|
|
|
|
|
if (size > G_MAXSSIZE)
|
|
|
|
return 0;
|
|
|
|
|
2020-07-06 17:38:40 +02:00
|
|
|
parsed_params = g_uri_parse_params ((const gchar *) data, (gssize) size,
|
|
|
|
"&", G_URI_PARAMS_NONE, &error);
|
2020-06-19 12:54:41 +02:00
|
|
|
if (parsed_params == NULL)
|
2020-07-06 17:38:40 +02:00
|
|
|
{
|
|
|
|
g_assert (error);
|
|
|
|
g_clear_error (&error);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2020-06-19 12:54:41 +02:00
|
|
|
|
2020-07-06 17:38:40 +02:00
|
|
|
g_assert_no_error (error);
|
2020-06-19 12:54:41 +02:00
|
|
|
g_hash_table_unref (parsed_params);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|