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

[Xen-changelog] [xen-unstable] libxl: fix libxl_get_cpu_topology



# HG changeset patch
# User Wei Liu <wei.liu2@xxxxxxxxxx>
# Date 1331653018 0
# Node ID 83ae523c96b45f6a6a32c518b2f320563dc17ea1
# Parent  0c4385ac103d1283cfbba31ca8f5cd9d520ff8f0
libxl: fix libxl_get_cpu_topology

Fix upper bound of for loop, thus preventing memory corruption.

Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Committed-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---


diff -r 0c4385ac103d -r 83ae523c96b4 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c       Tue Mar 13 15:34:54 2012 +0000
+++ b/tools/libxl/libxl.c       Tue Mar 13 15:36:58 2012 +0000
@@ -2873,7 +2873,7 @@
         goto fail;
     }
 
-    for (i = 0; i <= max_cpus; i++) {
+    for (i = 0; i < max_cpus; i++) {
 #define V(map, i) (map[i] == INVALID_TOPOLOGY_ID) ? \
     LIBXL_CPUTOPOLOGY_INVALID_ENTRY : map[i]
         ret[i].core = V(coremap, i);

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