diff options
author | gshapiro <gshapiro@FreeBSD.org> | 2003-02-08 20:31:29 +0000 |
---|---|---|
committer | gshapiro <gshapiro@FreeBSD.org> | 2003-02-08 20:31:29 +0000 |
commit | 842b56b9cabf175e7842ec5a3b29ff68353b3177 (patch) | |
tree | 2e81c43d391ed220f6656502de14ddfbb0de4ecd /contrib/sendmail/libsm/stdio.c | |
parent | 39e311b2e17a53f7ed02fcbe3820ca77b65486d5 (diff) | |
download | FreeBSD-src-842b56b9cabf175e7842ec5a3b29ff68353b3177.zip FreeBSD-src-842b56b9cabf175e7842ec5a3b29ff68353b3177.tar.gz |
Import sendmail 8.12.7
Diffstat (limited to 'contrib/sendmail/libsm/stdio.c')
-rw-r--r-- | contrib/sendmail/libsm/stdio.c | 10 |
1 files changed, 7 insertions, 3 deletions
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/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))) { |