]> andersk Git - openssh.git/blobdiff - monitor_fdpass.c
20070326
[openssh.git] / monitor_fdpass.c
index f0dd88e7edcd92b14aaa1e763afac10acdd8eec4..9f8e9cd550fe0764ee8bafdf23e0aca2e1cadcec 100644 (file)
@@ -1,3 +1,4 @@
+/* $OpenBSD: monitor_fdpass.c,v 1.12 2006/08/03 03:34:42 deraadt Exp $ */
 /*
  * Copyright 2001 Niels Provos <provos@citi.umich.edu>
  * All rights reserved.
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: monitor_fdpass.c,v 1.5 2004/06/21 17:36:31 avsm Exp $");
 
+#include <sys/types.h>
+#include <sys/socket.h>
 #include <sys/uio.h>
+#ifdef HAVE_SYS_UN_H
+#include <sys/un.h>
+#endif
+
+#include <errno.h>
+#include <string.h>
+#include <stdarg.h>
 
 #include "log.h"
 #include "monitor_fdpass.h"
@@ -113,6 +122,8 @@ mm_receive_fd(int sock)
                fatal("%s: no fd", __func__);
 #else
        cmsg = CMSG_FIRSTHDR(&msg);
+       if (cmsg == NULL)
+               fatal("%s: no message header", __func__);
 #ifndef BROKEN_CMSG_TYPE
        if (cmsg->cmsg_type != SCM_RIGHTS)
                fatal("%s: expected type %d got %d", __func__,
This page took 0.031954 seconds and 4 git commands to generate.