diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2010-11-30 16:52:48 +0000 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2010-11-30 16:52:48 +0000 |
commit | fdc8805362c6fc587bb7985c5290362ad3094f4e (patch) | |
tree | 8aa1713385894e334aabd5258ea968457cd65537 | |
parent | 8d28fe0ef284a2e786bc92b40fbb4620120de335 (diff) | |
download | libguestfs-fdc8805362c6fc587bb7985c5290362ad3094f4e.tar.gz libguestfs-fdc8805362c6fc587bb7985c5290362ad3094f4e.tar.xz libguestfs-fdc8805362c6fc587bb7985c5290362ad3094f4e.zip |
df: Fix segfault when using virt-df -a filename
If 'filename' doesn't contain a '/' character then virt-df
was calculating NULL as the basename and later segfaulting.
-rw-r--r-- | df/main.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -279,6 +279,8 @@ main (int argc, char *argv[]) switch (drvs->type) { case drv_a: name = strrchr (drvs->a.filename, '/'); + if (name == NULL) + name = drvs->a.filename; break; case drv_d: name = drvs->d.guest; |