282. [bug] lexer now returns ISC_R_RANGE if parsed integer is

too big for an usigned long.
This commit is contained in:
James Brister 2000-06-23 22:32:10 +00:00
parent 406ce0cd96
commit 8775909be9
2 changed files with 9 additions and 2 deletions

View file

@ -1,3 +1,6 @@
282. [bug] lexer now returns ISC_R_RANGE if parsed integer is
too big for an usigned long.
281. [bug] fixed list of recognised config file category names.
280. [func] Add isc-config.sh, which can be used to more

View file

@ -15,11 +15,12 @@
* SOFTWARE.
*/
/* $Id: lex.c,v 1.30 2000/06/22 21:56:57 tale Exp $ */
/* $Id: lex.c,v 1.31 2000/06/23 22:32:10 brister Exp $ */
#include <config.h>
#include <ctype.h>
#include <errno.h>
#include <stdlib.h>
#include <isc/buffer.h>
@ -512,7 +513,10 @@ isc_lex_gettoken(isc_lex_t *lex, unsigned int options, isc_token_t *tokenp) {
lex->specials[c]) {
pushback(source, c);
ulong = strtoul(lex->data, &e, 0);
if (*e == 0) {
if (ulong == ULONG_MAX &&
errno == ERANGE) {
return (ISC_R_RANGE);
} else if (*e == 0) {
tokenp->type =
isc_tokentype_number;
tokenp->value.as_ulong =