This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


[Xen-changelog] [xen-unstable] libxl: correct allocation size in libxl_l

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] libxl: correct allocation size in libxl_list_nics
From: Xen patchbot-unstable <patchbot@xxxxxxx>
Date: Thu, 29 Sep 2011 02:00:19 +0100
Delivery-date: Wed, 28 Sep 2011 18:01:16 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1317224144 -3600
# Node ID 72e3391299e42e35400f21bf5d9d54137275b8a6
# Parent  8877da7ba3a43dc39870bd6defa8d195b87fbaa8
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@xxxxxxxxxx>
Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Committed-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>

diff -r 8877da7ba3a4 -r 72e3391299e4 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c       Wed Sep 28 16:34:00 2011 +0100
+++ b/tools/libxl/libxl.c       Wed Sep 28 16:35:44 2011 +0100
@@ -1296,7 +1296,7 @@
                            libxl__sprintf(&gc, "%s/device/vif", dompath), 
     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-changelog mailing list

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] libxl: correct allocation size in libxl_list_nics, Xen patchbot-unstable <=