fuse: Fix segfault in guestmount --verbose.
authorRichard W.M. Jones <rjones@redhat.com>
Tue, 7 Dec 2010 13:29:40 +0000 (13:29 +0000)
committerRichard W.M. Jones <rjones@redhat.com>
Tue, 7 Dec 2010 13:29:40 +0000 (13:29 +0000)
If hash_delete returns NULL and --verbose option was given then
this would cause a segfault.

fuse/dircache.c

index 157035e..8cff0d3 100644 (file)
@@ -384,7 +384,7 @@ lsc_remove (Hash_table *ht, const char *pathname, Hash_data_freer freer)
 
   entry = hash_delete (ht, &key);
 
-  if (verbose)
+  if (verbose && entry)
     fprintf (stderr, "dir cache: invalidating entry %p (%s)\n",
              entry, entry->pathname);