From fdc8805362c6fc587bb7985c5290362ad3094f4e Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 30 Nov 2010 16:52:48 +0000 Subject: [PATCH] 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. --- df/main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/df/main.c b/df/main.c index 9565464..55e5eaa 100644 --- a/df/main.c +++ b/df/main.c @@ -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; -- 1.8.3.1