diff options
author | Wei Liu <wei.liu2@citrix.com> | 2012-03-13 15:36:58 +0000 |
---|---|---|
committer | Wei Liu <wei.liu2@citrix.com> | 2012-03-13 15:36:58 +0000 |
commit | bf321201462ccf313c716e8067ed6795f405182d (patch) | |
tree | 17637a80c3fe33b8a4646b5896aa7a3b0105aeb8 /tools | |
parent | eba0dfbbc2da7908b1d63e805c4159e795f7e9a1 (diff) | |
download | xen-bf321201462ccf313c716e8067ed6795f405182d.tar.gz xen-bf321201462ccf313c716e8067ed6795f405182d.tar.bz2 xen-bf321201462ccf313c716e8067ed6795f405182d.zip |
libxl: fix libxl_get_cpu_topology
Fix upper bound of for loop, thus preventing memory corruption.
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'tools')
-rw-r--r-- | 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 29eae743f5..f8b774543e 100644 --- a/tools/libxl/libxl.c +++ b/tools/libxl/libxl.c @@ -2873,7 +2873,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); |