[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen stable-4.2] libxl: Fix SEGV in network-attach



commit 9f1a6ff38b8e7bb97a016794115de28553a6559f
Author:     Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
AuthorDate: Thu Apr 18 17:42:04 2013 +0100
Commit:     Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
CommitDate: Thu Apr 18 17:42:04 2013 +0100

    libxl: Fix SEGV in network-attach
    
    When "device/vif" directory exists but is empty l!=NULL, but nb==0, so
    l[nb-1] is invalid.  Add missing check.
    
    Signed-off-by: Marek Marczykowski <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
    Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
    Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
---
 tools/libxl/libxl.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 3a58ef4..a6e9601 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -2572,7 +2572,8 @@ void libxl__device_nic_add(libxl__egc *egc, uint32_t 
domid,
             goto out_free;
         }
         if (!(l = libxl__xs_directory(gc, XBT_NULL,
-                                     libxl__sprintf(gc, "%s/device/vif", 
dompath), &nb))) {
+                                     libxl__sprintf(gc, "%s/device/vif", 
dompath), &nb)) ||
+            nb == 0) {
             nic->devid = 0;
         } else {
             nic->devid = strtoul(l[nb - 1], NULL, 10) + 1;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.