From: Yu Zhiguo Subject: [PATCH] libxc: Fix Segmentation fault of xend Date: Sat, 19 Jun 2010 14:23:01 +0800 Message-ID: <4C1C6245.9050402@cn.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser , "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org If /proc/xen/privcmd cannot be opened, start xend occurs Segmentation fault. Add check to fix it. Signed-off-by: Yu Zhiguo 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)