mirror of
git://git.code.sf.net/p/dhcpd-pools/code
synced 2025-12-17 16:26:59 +00:00
getdata: fix configuration parser bug
When { is wrote together with a word, such as
pool{
range 10.0.0.100 100.0.0.200;
range ..
the parser ignored first range, resulting it to disappear from analysis.
Reported-by: Robert Viou <robert.viou@ndsu.edu>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
parent
f3181bd1e4
commit
c5b12e4368
2 changed files with 7 additions and 3 deletions
1
THANKS
1
THANKS
|
|
@ -20,3 +20,4 @@ Thor Eivind Brantzeg
|
||||||
Ahmed AL Dakhil
|
Ahmed AL Dakhil
|
||||||
Adam Ciarcinski
|
Adam Ciarcinski
|
||||||
Rezso Gajdóczy
|
Rezso Gajdóczy
|
||||||
|
Robert Viou
|
||||||
|
|
|
||||||
|
|
@ -332,8 +332,10 @@ void parse_config(int is_include, const char *restrict config_file,
|
||||||
* shared-network DSL{ ... */
|
* shared-network DSL{ ... */
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
newclause = true;
|
newclause = true;
|
||||||
}
|
|
||||||
continue;
|
continue;
|
||||||
|
} else {
|
||||||
|
break;
|
||||||
|
}
|
||||||
case '}':
|
case '}':
|
||||||
if (quote == true) {
|
if (quote == true) {
|
||||||
break;
|
break;
|
||||||
|
|
@ -383,9 +385,10 @@ void parse_config(int is_include, const char *restrict config_file,
|
||||||
else if (newclause == true) {
|
else if (newclause == true) {
|
||||||
/* Insert string end & set state */
|
/* Insert string end & set state */
|
||||||
word[i] = '\0';
|
word[i] = '\0';
|
||||||
|
if (word[i - 1] != '{') {
|
||||||
newclause = false;
|
newclause = false;
|
||||||
|
}
|
||||||
i = 0;
|
i = 0;
|
||||||
|
|
||||||
argument = is_interesting_config_clause(word);
|
argument = is_interesting_config_clause(word);
|
||||||
}
|
}
|
||||||
/* words after range, shared-network or include */
|
/* words after range, shared-network or include */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue