- fix 2699
[oweals/gnunet.git] / src / util / os_priority.c
index e4bb41cf5d5f6501d3309237993985a5225415b5..983da42b17bb5f35015dc588895ee80286967bdc 100644 (file)
@@ -151,6 +151,13 @@ GNUNET_OS_install_parent_control_handler (void *cls,
     putenv (GNUNET_OS_CONTROL_PIPE "=");
     return;
   }
+  if (pipe_fd >= FD_SETSIZE)
+  {
+    LOG (GNUNET_ERROR_TYPE_ERROR,
+         "GNUNET_OS_CONTROL_PIPE `%s' contains garbage?\n", env_buf);
+    putenv (GNUNET_OS_CONTROL_PIPE "=");
+    return;
+  }
   /* Gcc will issue a warning here. What to do with it? */
 #if WINDOWS
   control_pipe = GNUNET_DISK_get_handle_from_w32_handle ((HANDLE) pipe_fd);