From: Todd C. Miller Date: Wed, 29 Aug 2018 16:54:32 +0000 (-0600) Subject: Use TIME_T_MAX when parsing the I/O log file timestamp and disallow X-Git-Tag: SUDO_1_8_25^2~11 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e0b413eb1708a67d28453017f14672c2ef3252b5;p=sudo Use TIME_T_MAX when parsing the I/O log file timestamp and disallow negative times. --- diff --git a/plugins/sudoers/iolog_util.c b/plugins/sudoers/iolog_util.c index 1704e27da..79f5e2fae 100644 --- a/plugins/sudoers/iolog_util.c +++ b/plugins/sudoers/iolog_util.c @@ -109,8 +109,7 @@ parse_logfile(const char *logfile) goto bad; } *ep = '\0'; - li->tstamp = sizeof(time_t) == 4 ? strtonum(cp, INT_MIN, INT_MAX, &errstr) : - strtonum(cp, LLONG_MIN, LLONG_MAX, &errstr); + li->tstamp = strtonum(cp, 0, TIME_T_MAX, &errstr); if (errstr != NULL) { sudo_warn(U_("%s: time stamp %s: %s"), logfile, cp, errstr); goto bad;