From 8775909be9fc67180fc480115716f88174e74471 Mon Sep 17 00:00:00 2001 From: James Brister Date: Fri, 23 Jun 2000 22:32:10 +0000 Subject: [PATCH] 282. [bug] lexer now returns ISC_R_RANGE if parsed integer is too big for an usigned long. --- CHANGES | 3 +++ lib/isc/lex.c | 8 ++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 10f40a6326..16f0509ca6 100644 --- a/CHANGES +++ b/CHANGES @@ -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 diff --git a/lib/isc/lex.c b/lib/isc/lex.c index 0f014de316..80395fa56f 100644 --- a/lib/isc/lex.c +++ b/lib/isc/lex.c @@ -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 #include +#include #include #include @@ -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 =