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

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



commit 21c31a811ca1705b71417fab520d9b39ae2ab3a7
Author:     Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
AuthorDate: Thu Apr 18 17:44:17 2013 +0100
Commit:     Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
CommitDate: Thu Apr 18 17:44:17 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>
    (cherry picked from commit 9f1a6ff38b8e7bb97a016794115de28553a6559f)
    
    Conflicts:
        tools/libxl/libxl.c
    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 19ef6a0..fbc6c07 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -1207,7 +1207,8 @@ int libxl_device_nic_add(libxl_ctx *ctx, uint32_t domid, 
libxl_device_nic *nic)
             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.1

_______________________________________________
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®.