diff options
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; |