diff options
-rw-r--r-- | RELNOTES | 3 | ||||
-rw-r--r-- | common/parse.c | 26 |
2 files changed, 17 insertions, 12 deletions
@@ -54,6 +54,9 @@ the README file. free not on its queue' error messages, thanks to a patch from Frode Nordahl. +- A parser bug was fixed that segfaulted if site-option-space was tried + to be used interchangeably with vendor-option-space. + Changes since 3.1.2rc1 - None. diff --git a/common/parse.c b/common/parse.c index b53abde9..f5e5197d 100644 --- a/common/parse.c +++ b/common/parse.c @@ -34,7 +34,7 @@ #ifndef lint static char copyright[] = -"$Id: parse.c,v 1.117.8.8 2008/10/08 16:30:54 dhankins Exp $ Copyright (c) 2004-2008 Internet Systems Consortium. All rights reserved.\n"; +"$Id: parse.c,v 1.117.8.9 2009/02/03 23:51:44 dhankins Exp $ Copyright (c) 2004-2008 Internet Systems Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -4761,7 +4761,7 @@ int parse_option_token (rv, cfile, fmt, expr, uniform, lookups) { const char *val; enum dhcp_token token; - struct expression *t = (struct expression *)0; + struct expression *t = NULL; unsigned char buf [4]; unsigned len; unsigned char *ob; @@ -4813,11 +4813,12 @@ int parse_option_token (rv, cfile, fmt, expr, uniform, lookups) (const unsigned char *)val, len, 1, 1, MDL)) log_fatal ("No memory for \"%s\"", val); - } else if ((*fmt) [1] != 'o') { - parse_warn (cfile, "expecting string %s.", - "or hexadecimal data"); - skip_to_semi (cfile); } else { + if ((*fmt) [1] != 'o') { + parse_warn(cfile, "expecting string " + "or hexadecimal data"); + skip_to_semi (cfile); + } return 0; } } @@ -4981,12 +4982,13 @@ int parse_option_token (rv, cfile, fmt, expr, uniform, lookups) skip_to_semi (cfile); return 0; } - if (expr) { - if (!make_concat (rv, expr, t)) - return 0; - } else - expression_reference (rv, t, MDL); - expression_dereference (&t, MDL); + + if (!make_concat (rv, expr, t)) + return 0; + + if (t != NULL) + expression_dereference (&t, MDL); + return 1; } |