From 842b56b9cabf175e7842ec5a3b29ff68353b3177 Mon Sep 17 00:00:00 2001 From: gshapiro Date: Sat, 8 Feb 2003 20:31:29 +0000 Subject: Import sendmail 8.12.7 --- contrib/sendmail/libsm/stdio.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'contrib/sendmail/libsm/stdio.c') diff --git a/contrib/sendmail/libsm/stdio.c b/contrib/sendmail/libsm/stdio.c index c3ab72d..0e5165f 100644 --- a/contrib/sendmail/libsm/stdio.c +++ b/contrib/sendmail/libsm/stdio.c @@ -13,7 +13,7 @@ */ #include -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 #include #include @@ -24,9 +24,9 @@ SM_RCSID("@(#)$Id: stdio.c,v 1.56 2002/04/03 21:55:15 ca Exp $") #include #include #include -#include #include #include +#include #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))) { -- cgit v1.1