about summary refs log tree commit diff
path: root/nscd/nscd_helper.c
diff options
context:
space:
mode:
Diffstat (limited to 'nscd/nscd_helper.c')
-rw-r--r--nscd/nscd_helper.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/nscd/nscd_helper.c b/nscd/nscd_helper.c
index 1f56ccf6aa..bab4913e9a 100644
--- a/nscd/nscd_helper.c
+++ b/nscd/nscd_helper.c
@@ -271,9 +271,10 @@ get_mapping (request_type type, const char *key,
 
   mapfd = *(int *) CMSG_DATA (cmsg);
 
-  if (__builtin_expect (CMSG_FIRSTHDR (&msg)->cmsg_len
-			!= CMSG_LEN (sizeof (int)), 0))
-    goto out_close;
+  if (__builtin_expect (CMSG_FIRSTHDR (&msg) == NULL
+			|| (CMSG_FIRSTHDR (&msg)->cmsg_len
+			    != CMSG_LEN (sizeof (int))), 0))
+    goto out_close2;
 
   struct stat64 st;
   if (__builtin_expect (strcmp (resdata, key) != 0, 0)