From: Jon Ludlam Date: Mon, 8 Mar 2010 11:28:56 +0000 (+0000) Subject: CA-38105: Fix segfault in fork-and-exec-daemon. X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=924f7628552dcc3f57a6c49b5ee13cee8a184eea;p=xcp%2Fxen-api-libs.git CA-38105: Fix segfault in fork-and-exec-daemon. The segfault would have happened when a message was receieved on this socket without an associated fd being sent. This is bad behaviour on the part of the client, but shouldn't cause a segfault. This patch fixes the segfault, but we'll need to fix the client too! Signed-off-by: Jon Ludlam 0) { + if(ret>0 && msg.msg_controllen>0) { cmsg = CMSG_FIRSTHDR(&msg); if(cmsg->cmsg_level == SOL_SOCKET && (cmsg->cmsg_type == SCM_RIGHTS)) { fd=Val_int(*(int*)CMSG_DATA(cmsg));