git.annexia.org
/
libguestfs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8d28fe0
)
df: Fix segfault when using virt-df -a filename
author
Richard W.M. Jones
<rjones@redhat.com>
Tue, 30 Nov 2010 16:52:48 +0000
(16:52 +0000)
committer
Richard W.M. Jones
<rjones@redhat.com>
Tue, 30 Nov 2010 16:52:48 +0000
(16:52 +0000)
If 'filename' doesn't contain a '/' character then virt-df
was calculating NULL as the basename and later segfaulting.
df/main.c
patch
|
blob
|
history
diff --git
a/df/main.c
b/df/main.c
index
9565464
..
55e5eaa
100644
(file)
--- 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;