Stefano Stabellini
2009-Nov-30 14:27 UTC
[Xen-devel] [PATCH] libxenlight: fix segfault when reading blktap2 devs
Hi all, 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> --- diff -r 1b0554b495f8 tools/libxl/libxl.c --- a/tools/libxl/libxl.c Mon Nov 30 14:24:21 2009 +0000 +++ b/tools/libxl/libxl.c Mon Nov 30 14:24:56 2009 +0000 @@ -940,6 +940,8 @@ 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); _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel