Ian Campbell
2011-Sep-21 13:54 UTC
[Xen-devel] [PATCH] libxl: correct allocation size in libxl_list_nics
# HG changeset patch # User Ian Campbell <ian.campbell@citrix.com> # Date 1316609964 -3600 # Node ID b11af4a5cdc6a94e41a81d456f07b4d70cdb5ffe # Parent b43fd821d1aebc8671e684bfc285cda7a6002ff1 libxl: correct allocation size in libxl_list_nics The function returns a list of libxl_nicinfo not libxl_device_nic. Causes memory corruption on free. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> diff -r b43fd821d1ae -r b11af4a5cdc6 tools/libxl/libxl.c --- a/tools/libxl/libxl.c Wed Sep 21 13:59:24 2011 +0100 +++ b/tools/libxl/libxl.c Wed Sep 21 13:59:24 2011 +0100 @@ -1296,7 +1296,7 @@ libxl_nicinfo *libxl_list_nics(libxl_ctx libxl__sprintf(&gc, "%s/device/vif", dompath), &nb_nics); if (!l) goto err; - nics = res = calloc(nb_nics, sizeof (libxl_device_nic)); + nics = res = calloc(nb_nics, sizeof (libxl_nicinfo)); if (!res) goto err; for (*nb = nb_nics; nb_nics > 0; --nb_nics, ++l, ++nics) { _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ian Jackson
2011-Sep-28 15:35 UTC
Re: [Xen-devel] [PATCH] libxl: correct allocation size in libxl_list_nics
Ian Campbell writes ("[Xen-devel] [PATCH] libxl: correct allocation size in libxl_list_nics"):> libxl: correct allocation size in libxl_list_nicsAcked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com> _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel