projects
/
xen.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a2bfc84
)
libxenlight: fix segfault when reading blktap2 devs
author
Keir Fraser
<keir.fraser@citrix.com>
Tue, 1 Dec 2009 13:34:38 +0000
(13:34 +0000)
committer
Keir Fraser
<keir.fraser@citrix.com>
Tue, 1 Dec 2009 13:34:38 +0000
(13:34 +0000)
This patch fixes a possible segfault when reading from
/sys/class/blktap2/devices, if the line read is empty.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
tools/libxl/libxl.c
patch
|
blob
|
history
diff --git
a/tools/libxl/libxl.c
b/tools/libxl/libxl.c
index abab8379529b4360bc6ca68c321210b8d2a0c69d..eaa22253e6d422b033d255f3015adb44a93d5344 100644
(file)
--- a/
tools/libxl/libxl.c
+++ b/
tools/libxl/libxl.c
@@
-937,6
+937,8
@@
static char *get_blktap2_device(struct libxl_ctx *ctx, char *name, char *type)
while (!feof(f)) {
fscanf(f, "%d %s", &devnum, buf);
p = strchr(buf, ':');
+ if (p == NULL)
+ continue;
p++;
if (!strcmp(p, name) && !strncmp(buf, type, 3)) {
fclose(f);