dhcp/dhcp-4.3.0-64_bit_lease_parse.patch

84 lines
2.3 KiB
Diff
Raw Permalink Normal View History

2014-06-17 16:24:23 +04:00
--- dhcp-4.3.0/common/parse.c.64-bit_lease_parse 2014-01-31 14:20:49.000000000 -0500
+++ dhcp-4.3.0/common/parse.c 2014-06-15 11:48:48.559669323 -0400
@@ -932,8 +932,8 @@ TIME
2013-07-31 23:22:01 +04:00
parse_date_core(cfile)
struct parse *cfile;
{
- int guess;
- int tzoff, year, mon, mday, hour, min, sec;
+ TIME guess;
+ long int tzoff, year, mon, mday, hour, min, sec;
const char *val;
enum dhcp_token token;
static int months[11] = { 31, 59, 90, 120, 151, 181,
2014-06-17 16:24:23 +04:00
@@ -959,7 +959,7 @@ parse_date_core(cfile)
2013-07-31 23:22:01 +04:00
}
2014-06-17 16:24:23 +04:00
skip_token(&val, NULL, cfile); /* consume number */
2013-07-31 23:22:01 +04:00
- guess = atoi(val);
+ guess = atol(val);
return((TIME)guess);
}
2014-06-17 16:24:23 +04:00
@@ -987,7 +987,7 @@ parse_date_core(cfile)
2013-07-31 23:22:01 +04:00
somebody invents a time machine, I think we can safely disregard
it. This actually works around a stupid Y2K bug that was present
in a very early beta release of dhcpd. */
- year = atoi(val);
+ year = atol(val);
if (year > 1900)
year -= 1900;
2014-06-17 16:24:23 +04:00
@@ -1011,7 +1011,7 @@ parse_date_core(cfile)
2013-07-31 23:22:01 +04:00
return((TIME)0);
}
2014-06-17 16:24:23 +04:00
skip_token(&val, NULL, cfile); /* consume month */
2013-07-31 23:22:01 +04:00
- mon = atoi(val) - 1;
+ mon = atol(val) - 1;
/* Slash separating month from day... */
token = peek_token(&val, NULL, cfile);
2014-06-17 16:24:23 +04:00
@@ -1033,7 +1033,7 @@ parse_date_core(cfile)
2013-07-31 23:22:01 +04:00
return((TIME)0);
}
2014-06-17 16:24:23 +04:00
skip_token(&val, NULL, cfile); /* consume day of month */
2013-07-31 23:22:01 +04:00
- mday = atoi(val);
+ mday = atol(val);
/* Hour... */
token = peek_token(&val, NULL, cfile);
2014-06-17 16:24:23 +04:00
@@ -1044,7 +1044,7 @@ parse_date_core(cfile)
2013-07-31 23:22:01 +04:00
return((TIME)0);
}
2014-06-17 16:24:23 +04:00
skip_token(&val, NULL, cfile); /* consume hour */
2013-07-31 23:22:01 +04:00
- hour = atoi(val);
+ hour = atol(val);
/* Colon separating hour from minute... */
token = peek_token(&val, NULL, cfile);
2014-06-17 16:24:23 +04:00
@@ -1066,7 +1066,7 @@ parse_date_core(cfile)
2013-07-31 23:22:01 +04:00
return((TIME)0);
}
2014-06-17 16:24:23 +04:00
skip_token(&val, NULL, cfile); /* consume minute */
2013-07-31 23:22:01 +04:00
- min = atoi(val);
+ min = atol(val);
/* Colon separating minute from second... */
token = peek_token(&val, NULL, cfile);
2014-06-17 16:24:23 +04:00
@@ -1088,13 +1088,13 @@ parse_date_core(cfile)
2013-07-31 23:22:01 +04:00
return((TIME)0);
}
2014-06-17 16:24:23 +04:00
skip_token(&val, NULL, cfile); /* consume second */
2013-07-31 23:22:01 +04:00
- sec = atoi(val);
+ sec = atol(val);
tzoff = 0;
token = peek_token(&val, NULL, cfile);
if (token == NUMBER) {
2014-06-17 16:24:23 +04:00
skip_token(&val, NULL, cfile); /* consume tzoff */
2013-07-31 23:22:01 +04:00
- tzoff = atoi(val);
+ tzoff = atol(val);
} else if (token != SEMI) {
2014-06-17 16:24:23 +04:00
skip_token(&val, NULL, cfile);
2013-07-31 23:22:01 +04:00
parse_warn(cfile,