diff options
author | Philip Withnall <philip.withnall@collabora.co.uk> | 2015-09-15 10:00:44 +0100 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2017-04-08 01:16:04 -0400 |
commit | a5b58da6bf3bb21cbd3d030a369aad330f90f891 (patch) | |
tree | 90ceb6d1ce9b6c7912e766219e69eba0c5afab54 /glib/gfileutils.c | |
parent | 005dfeacba142af598d57f28da1e7f79c17d8fe1 (diff) | |
download | glib-a5b58da6bf3bb21cbd3d030a369aad330f90f891.tar.gz |
gfileutils: Add precondition checks to g_file_test()
Otherwise g_file_test(NULL, …) causes a call to access(NULL, …) on
Linux, which is disallowed and valgrind complains about it.
https://bugzilla.gnome.org/show_bug.cgi?id=755046
Diffstat (limited to 'glib/gfileutils.c')
-rw-r--r-- | glib/gfileutils.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/glib/gfileutils.c b/glib/gfileutils.c index 40775e260..dbf96911e 100644 --- a/glib/gfileutils.c +++ b/glib/gfileutils.c @@ -317,6 +317,8 @@ gboolean g_file_test (const gchar *filename, GFileTest test) { + g_return_val_if_fail (filename != NULL, FALSE); + #ifdef G_OS_WIN32 /* stuff missing in std vc6 api */ # ifndef INVALID_FILE_ATTRIBUTES |