Do some rough bounds checks on the age

This commit is contained in:
Howard Chu 2005-10-14 23:29:42 +00:00
parent b2bf5094eb
commit df27731f66

View file

@ -360,6 +360,9 @@ log_age_parse(char *agestr)
t1 = strtol( agestr, &endptr, 10 );
/* Is there a days delimiter? */
if ( *endptr == '+' ) {
/* 32 bit time only covers about 68 years */
if ( t1 < 0 || t1 > 25000 )
return -1;
t1 *= 24;
gotdays = 1;
} else if ( *endptr != ':' ) {