mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-07-29 13:23:31 +02:00
fuzzing: Add fuzz tests for GUri parsing and escaping
Signed-off-by: Philip Withnall <withnall@endlessm.com> Helps: #110
This commit is contained in:
committed by
Marc-André Lureau
parent
d83d68d64c
commit
dd11160f7f
20
fuzzing/fuzz_uri_parse_params.c
Normal file
20
fuzzing/fuzz_uri_parse_params.c
Normal file
@@ -0,0 +1,20 @@
|
||||
#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;
|
||||
}
|
Reference in New Issue
Block a user