2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

325. [bug] isc_lex_gettoken was processing octal strings when

ISC_LEXOPT_CNUMBER was not set.
This commit is contained in:
Mark Andrews
2000-07-11 02:44:54 +00:00
parent 6c3371d89a
commit 5c0a406664
2 changed files with 9 additions and 2 deletions

View File

@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: lex.c,v 1.32 2000/07/10 05:11:17 marka Exp $ */
/* $Id: lex.c,v 1.33 2000/07/11 02:44:54 marka Exp $ */
#include <config.h>
@@ -511,8 +511,13 @@ isc_lex_gettoken(isc_lex_t *lex, unsigned int options, isc_token_t *tokenp) {
if (c == ' ' || c == '\t' || c == '\r' ||
c == '\n' || c == EOF ||
lex->specials[c]) {
int base;
if ((options & ISC_LEXOPT_CNUMBER) != 0)
base = 0;
else
base = 10;
pushback(source, c);
ulong = strtoul(lex->data, &e, 0);
ulong = strtoul(lex->data, &e, base);
if (ulong == ULONG_MAX &&
errno == ERANGE) {
return (ISC_R_RANGE);