Merge branch 'fuzz-path-fix' into 'master'

fuzzing: Fix assertion failure in fuzz_paths.c

See merge request GNOME/glib!2013
This commit is contained in:
Simon McVittie 2021-03-25 17:28:20 +00:00
commit 6d50032167

View File

@ -19,10 +19,10 @@ LLVMFuzzerTestOneInput (const unsigned char *data, size_t size)
g_assert (skipped_root == NULL || skipped_root <= (const gchar *) nul_terminated_data + size); g_assert (skipped_root == NULL || skipped_root <= (const gchar *) nul_terminated_data + size);
basename = g_path_get_basename ((const gchar *) nul_terminated_data); basename = g_path_get_basename ((const gchar *) nul_terminated_data);
g_assert (strlen (basename) <= size); g_assert (strcmp (basename, ".") == 0 || strlen (basename) <= size);
dirname = g_path_get_dirname ((const gchar *) nul_terminated_data); dirname = g_path_get_dirname ((const gchar *) nul_terminated_data);
g_assert (strlen (dirname) <= size); g_assert (strcmp (dirname, ".") == 0 || strlen (dirname) <= size);
g_free (nul_terminated_data); g_free (nul_terminated_data);
g_free (dirname); g_free (dirname);