Browse Source

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@
OPENBSD_4_0
otto 18 years ago
parent
commit
fc47aa1fcc
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      src/usr.sbin/ntpd/parse.y

+ 3
- 2
src/usr.sbin/ntpd/parse.y View File

@ -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> * Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
@ -30,6 +30,7 @@
#include <limits.h> #include <limits.h>
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include <string.h> #include <string.h>
#include <syslog.h> #include <syslog.h>
@ -208,7 +209,7 @@ number : STRING {
u_long ulval; u_long ulval;
const char *errstr; const char *errstr;
ulval = strtonum($1, 0, ULONG_MAX, &errstr);
ulval = strtonum($1, 0, LONG_MAX, &errstr);
if (errstr) { if (errstr) {
yyerror("\"%s\" invalid: %s", $1, errstr); yyerror("\"%s\" invalid: %s", $1, errstr);
free($1); free($1);


Loading…
Cancel
Save