diff options
author | gshapiro <gshapiro@FreeBSD.org> | 2001-08-21 01:31:44 +0000 |
---|---|---|
committer | gshapiro <gshapiro@FreeBSD.org> | 2001-08-21 01:31:44 +0000 |
commit | 289b381b31415647269c7520d881017e2dcb27f1 (patch) | |
tree | 2cfd003f88c7ffe91602b6a6c0b69bee7b4d62db /contrib/sendmail/src/trace.c | |
parent | 1164bba81c60839834c20d6e34983b4cfb9c05b4 (diff) | |
download | FreeBSD-src-289b381b31415647269c7520d881017e2dcb27f1.zip FreeBSD-src-289b381b31415647269c7520d881017e2dcb27f1.tar.gz |
Import sendmail 8.11.6
Diffstat (limited to 'contrib/sendmail/src/trace.c')
-rw-r--r-- | contrib/sendmail/src/trace.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/contrib/sendmail/src/trace.c b/contrib/sendmail/src/trace.c index 6f08dea..735ef83 100644 --- a/contrib/sendmail/src/trace.c +++ b/contrib/sendmail/src/trace.c @@ -12,7 +12,7 @@ */ #ifndef lint -static char id[] = "@(#)$Id: trace.c,v 8.20.22.2 2000/09/17 17:04:27 gshapiro Exp $"; +static char id[] = "@(#)$Id: trace.c,v 8.20.22.4 2001/08/15 13:05:43 ca Exp $"; #endif /* ! lint */ #include <sendmail.h> @@ -63,7 +63,7 @@ void tTflag(s) register char *s; { - int first, last; + unsigned int first, last; register unsigned int i; if (*s == '\0') @@ -73,16 +73,28 @@ tTflag(s) { /* find first flag to set */ i = 0; - while (isascii(*s) && isdigit(*s)) + while (isascii(*s) && isdigit(*s) && i < tTsize) i = i * 10 + (*s++ - '0'); + + /* + ** skip over rest of a too large number + ** Maybe we should complain if out-of-bounds values are used. + */ + + while (isascii(*s) && isdigit(*s) && i >= tTsize) + s++; first = i; /* find last flag to set */ if (*s == '-') { i = 0; - while (isascii(*++s) && isdigit(*s)) + while (isascii(*++s) && isdigit(*s) && i < tTsize) i = i * 10 + (*s - '0'); + + /* skip over rest of a too large number */ + while (isascii(*s) && isdigit(*s) && i >= tTsize) + s++; } last = i; |