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] libxc: Fix Segmentation fault of xend

To: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] libxc: Fix Segmentation fault of xend
From: Yu Zhiguo <yuzg@xxxxxxxxxxxxxx>
Date: Sat, 19 Jun 2010 14:23:01 +0800
Cc:
Delivery-date: Fri, 18 Jun 2010 23:23:36 -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
User-agent: Thunderbird 3.0a1 (Windows/2008050715)
If /proc/xen/privcmd cannot be opened,
start xend occurs Segmentation fault.
Add check to fix it.

Signed-off-by: Yu Zhiguo <yuzg@xxxxxxxxxxxxxx>

diff -r b9c541d9c138 -r 659e4b69d26b tools/libxc/xc_private.c
--- a/tools/libxc/xc_private.c  Tue Jun 15 13:27:14 2010 +0100
+++ b/tools/libxc/xc_private.c  Sat Jun 19 22:24:09 2010 +0800
@@ -82,8 +82,10 @@
 
 void xc_clear_last_error(xc_interface *xch)
 {
-    xch->last_error.code = XC_ERROR_NONE;
-    xch->last_error.message[0] = '\0';
+    if (xch) {
+        xch->last_error.code = XC_ERROR_NONE;
+        xch->last_error.message[0] = '\0';
+    }
 }
 
 const char *xc_error_code_to_desc(int code)


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