summaryrefslogtreecommitdiff
path: root/contrib/sendmail/libsm/stdio.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/sendmail/libsm/stdio.c')
-rw-r--r--contrib/sendmail/libsm/stdio.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/contrib/sendmail/libsm/stdio.c b/contrib/sendmail/libsm/stdio.c
index c3ab72d0124b9..0e5165f097b64 100644
--- a/contrib/sendmail/libsm/stdio.c
+++ b/contrib/sendmail/libsm/stdio.c
@@ -13,7 +13,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Id: stdio.c,v 1.56 2002/04/03 21:55:15 ca Exp $")
+SM_RCSID("@(#)$Id: stdio.c,v 1.56.2.3 2002/10/22 23:07:19 ca Exp $")
#include <unistd.h>
#include <errno.h>
#include <fcntl.h>
@@ -24,9 +24,9 @@ SM_RCSID("@(#)$Id: stdio.c,v 1.56 2002/04/03 21:55:15 ca Exp $")
#include <sm/assert.h>
#include <sm/varargs.h>
#include <sm/io.h>
-#include <sm/fdset.h>
#include <sm/setjmp.h>
#include <sm/conf.h>
+#include <sm/fdset.h>
#include "local.h"
/*
@@ -353,6 +353,11 @@ sm_stdgetinfo(fp, what, valp)
fd_set readfds;
struct timeval timeout;
+ if (SM_FD_SETSIZE > 0 && fp->f_file >= SM_FD_SETSIZE)
+ {
+ errno = EINVAL;
+ return -1;
+ }
FD_ZERO(&readfds);
SM_FD_SET(fp->f_file, &readfds);
timeout.tv_sec = 0;
@@ -422,7 +427,6 @@ sm_stdfdopen(fp, info, flags, rpool)
/* Make sure the mode the user wants is a subset of the actual mode. */
if ((fdflags = fcntl(fd, F_GETFL, 0)) < 0)
return -1;
-
tmp = fdflags & O_ACCMODE;
if (tmp != O_RDWR && (tmp != (oflags & O_ACCMODE)))
{