WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] libxenlight: fix segfault when reading bl

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] libxenlight: fix segfault when reading blktap2 devs
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 01 Dec 2009 06:30:26 -0800
Delivery-date: Tue, 01 Dec 2009 06:30:37 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1259674478 0
# Node ID c0ceddd46bb0efb0714efb44eed1cfa4a9dd9205
# Parent  1a6a109e48cef8920e2619ecef3c0d69b218d827
libxenlight: fix segfault when reading blktap2 devs

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@xxxxxxxxxxxxx>
---
 tools/libxl/libxl.c |    2 ++
 1 files changed, 2 insertions(+)

diff -r 1a6a109e48ce -r c0ceddd46bb0 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c       Tue Dec 01 13:34:10 2009 +0000
+++ b/tools/libxl/libxl.c       Tue Dec 01 13:34:38 2009 +0000
@@ -937,6 +937,8 @@ static char *get_blktap2_device(struct l
     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-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] libxenlight: fix segfault when reading blktap2 devs, Xen patchbot-unstable <=