WARNING - OLD ARCHIVES

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/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH]: xl: Fix NULL deref in libxl_ctx_free()

To: Xen Devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH]: xl: Fix NULL deref in libxl_ctx_free()
From: Gianni Tedesco <gianni.tedesco@xxxxxxxxxx>
Date: Mon, 6 Sep 2010 14:20:19 +0100
Cc: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>, Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Delivery-date: Mon, 06 Sep 2010 06:23:27 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
xc_interface_close() will de-reference a NULL handle, check for this
condition in libxl_ctx_free() before calling.

Signed-off-by: Gianni Tedesco <gianni.tedesco@xxxxxxxxxx>

diff -r 245ea9337bb8 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c       Mon Sep 06 14:17:06 2010 +0100
+++ b/tools/libxl/libxl.c       Mon Sep 06 14:20:07 2010 +0100
@@ -67,7 +67,7 @@ int libxl_ctx_init(libxl_ctx *ctx, int v
 
 int libxl_ctx_free(libxl_ctx *ctx)
 {
-    xc_interface_close(ctx->xch);
+    if (ctx->xch) xc_interface_close(ctx->xch);
     libxl_version_info_destroy(&ctx->version_info);
     if (ctx->xsh) xs_daemon_close(ctx->xsh); 
     return 0;



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH]: xl: Fix NULL deref in libxl_ctx_free(), Gianni Tedesco <=