xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] libxc: Fix Segmentation fault of xend
@ 2010-06-19  6:23 Yu Zhiguo
  2010-06-21 14:03 ` Ian Jackson
  0 siblings, 1 reply; 7+ messages in thread
From: Yu Zhiguo @ 2010-06-19  6:23 UTC (permalink / raw)
  To: Keir Fraser, xen-devel@lists.xensource.com

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

Signed-off-by: Yu Zhiguo <yuzg@cn.fujitsu.com>

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)

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-06-22 14:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-19  6:23 [PATCH] libxc: Fix Segmentation fault of xend Yu Zhiguo
2010-06-21 14:03 ` Ian Jackson
2010-06-21 14:03   ` Ian Jackson
2010-06-21 14:06     ` Keir Fraser
2010-06-21 14:11       ` Ian Jackson
2010-06-22  0:58   ` [PATCH] lowlevel: " Yu Zhiguo
2010-06-22 14:58     ` Ian Jackson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).