diff options
author | Otto Moerbeek <otto@cvs.openbsd.org> | 2006-06-01 06:07:00 +0000 |
---|---|---|
committer | Otto Moerbeek <otto@cvs.openbsd.org> | 2006-06-01 06:07:00 +0000 |
commit | 852549c156d4217f04ef6035bd5517c1359a956e (patch) | |
tree | f0856f7cec349535157906dcba50efef01002b49 /usr.sbin/ntpd | |
parent | 5d88ba5921a9ac2407094d589e9c0a853d6e838d (diff) |
even though the bounds are long long having an upper bound of
ULONG_MAX does not work; the max upper bound is LONG_MAX,
since LONG_MAX == LLONG_MAX on 64bit archs. ok deraadt@ henning@
Diffstat (limited to 'usr.sbin/ntpd')
-rw-r--r-- | usr.sbin/ntpd/parse.y | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/ntpd/parse.y b/usr.sbin/ntpd/parse.y index 8405f861eef..4838f255e0b 100644 --- a/usr.sbin/ntpd/parse.y +++ b/usr.sbin/ntpd/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.28 2006/05/28 20:39:16 henning Exp $ */ +/* $OpenBSD: parse.y,v 1.29 2006/06/01 06:06:59 otto Exp $ */ /* * Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -30,6 +30,7 @@ #include <limits.h> #include <stdarg.h> #include <stdio.h> +#include <stdlib.h> #include <string.h> #include <syslog.h> @@ -208,7 +209,7 @@ number : STRING { u_long ulval; const char *errstr; - ulval = strtonum($1, 0, ULONG_MAX, &errstr); + ulval = strtonum($1, 0, LONG_MAX, &errstr); if (errstr) { yyerror("\"%s\" invalid: %s", $1, errstr); free($1); |