# HG changeset patch # User Jonathan Ludlam # Date 1267181730 0 # Node ID 148df13bcee2161cc869eb082e6a66721da34750 # Parent 45b22c29867df47adc2dc21a008c6f6730e6e4fc 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));