diff options
author | Shawn Routhier <sar@isc.org> | 2015-04-15 19:57:00 -0700 |
---|---|---|
committer | Shawn Routhier <sar@isc.org> | 2015-04-15 19:57:00 -0700 |
commit | 90fdd3376df92350c6a01a486786c66120217e11 (patch) | |
tree | ee53b5124f68bfe31ef6f635555baf35194ed4f3 /common | |
parent | 90a062fb20c4573922c92daee7a535c6ffa30caa (diff) | |
download | isc-dhcp-90fdd3376df92350c6a01a486786c66120217e11.tar.gz |
[master] Treat dates greater than 2038 as never expire (infinite)
Diffstat (limited to 'common')
-rw-r--r-- | common/parse.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/common/parse.c b/common/parse.c index 7255fee3..77978319 100644 --- a/common/parse.c +++ b/common/parse.c @@ -3,7 +3,7 @@ Common parser code for dhcpd and dhclient. */ /* - * Copyright (c) 2004-2014 by Internet Systems Consortium, Inc. ("ISC") + * Copyright (c) 2004-2015 by Internet Systems Consortium, Inc. ("ISC") * Copyright (c) 1995-2003 by Internet Software Consortium * * Permission to use, copy, modify, and distribute this software for any @@ -1108,6 +1108,13 @@ parse_date_core(cfile) return((TIME)0); } + /* If the year is 2038 or greater return the max time to avoid + * overflow issues. We could try and be more precise but there + * doesn't seem to be a good reason to worry about it and waste + * the cpu looking at the rest of the date. */ + if (year >= 138) + return(MAX_TIME); + /* Guess the time value... */ guess = ((((((365 * (year - 70) + /* Days in years since '70 */ (year - 69) / 4 + /* Leap days since '70 */ |