]> git.sur5r.net Git - openldap/commitdiff
Do some rough bounds checks on the age
authorHoward Chu <hyc@openldap.org>
Fri, 14 Oct 2005 23:29:42 +0000 (23:29 +0000)
committerHoward Chu <hyc@openldap.org>
Fri, 14 Oct 2005 23:29:42 +0000 (23:29 +0000)
servers/slapd/overlays/accesslog.c

index 4ad8f9e042c761f45531f75730215da132b868f6..b3d78b1ef4aa2da1b1e40432ee83da90674dc745 100644 (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 != ':' ) {