Commit d09c2196 authored by Philip Withnall's avatar Philip Withnall

glocalfile: Assert against a potential NULL pointer dereference

This was confusing some static analysis. Through canonicalize_filename()
at construction time, we guaranteed that ->filename is canonical and
absolute, so g_path_skip_root() should never fail.

https://bugzilla.gnome.org/show_bug.cgi?id=731988
parent 28dcafa0
......@@ -503,8 +503,11 @@ g_local_file_get_parent (GFile *file)
char *dirname;
GFile *parent;
/* Check for root */
/* Check for root; local->filename is guaranteed to be absolute, so
* g_path_skip_root() should never return NULL. */
non_root = g_path_skip_root (local->filename);
g_assert (non_root != NULL);
if (*non_root == 0)
return NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment