[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH] libxl: fix libxl_get_cpu_topology
Fix upper bound of for loop, thus preventing memory corruption. Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx> --- tools/libxl/libxl.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c index d7eb2c5..f7b8bb5 100644 --- a/tools/libxl/libxl.c +++ b/tools/libxl/libxl.c @@ -2872,7 +2872,7 @@ libxl_cputopology *libxl_get_cpu_topology(libxl_ctx *ctx, int *nr) 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); -- 1.7.2.5 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |