|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH] libxl: fix libxl_get_cpu_topology
On Tue, 2012-03-13 at 10:09 +0000, Wei Liu wrote:
> 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>
> ---
> 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);
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |