[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] libxc: Fix Segmentation fault of xend



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1277110512 -3600
# Node ID 05e127771b86b3b58e8a20cd526c26d0896c3752
# Parent  9f257ab92ae4c07dc39b63aabd9867f179d6da25
libxc: Fix Segmentation fault of xend

If /proc/xen/privcmd cannot be opened,
start xend occurs Segmentation fault.
Add check to fix it.

Signed-off-by: Yu Zhiguo <yuzg@xxxxxxxxxxxxxx>
---
 tools/libxc/xc_private.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff -r 9f257ab92ae4 -r 05e127771b86 tools/libxc/xc_private.c
--- a/tools/libxc/xc_private.c  Fri Jun 18 14:09:44 2010 +0100
+++ b/tools/libxc/xc_private.c  Mon Jun 21 09:55:12 2010 +0100
@@ -82,8 +82,10 @@ const xc_error *xc_get_last_error(xc_int
 
 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-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.