Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dhcp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
71
Issues
71
List
Boards
Labels
Service Desk
Milestones
Merge Requests
18
Merge Requests
18
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ISC Open Source Projects
dhcp
Commits
71d7e9aa
Commit
71d7e9aa
authored
Sep 08, 2014
by
Thomas Markwalder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[master] Corrected right brace detection in parsing
Merges in rt36021
parent
267a248d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
24 deletions
+33
-24
RELNOTES
RELNOTES
+4
-1
common/parse.c
common/parse.c
+29
-23
No files found.
RELNOTES
View file @
71d7e9aa
...
...
@@ -54,12 +54,15 @@ by Eric Young (eay@cryptsoft.com).
Changes
since
4.3.1
-
Corrected
parser
's right brace matching when a statement contains an error.
[ISC-Bugs #36021]
- TSIG-authenticated dynamic DNS updates now support the use of these
additional algorithms: hmac-sha1, hmac-sha224, hmac-sha256, hmac-sha384,
and hmac-sha512
[ISC-Bugs #36947]
-
Corrected
rate
limiting
checks
for
bad
packet
logging
.
- Corrected rate limiting checks for bad packet logging.
[ISC-Bugs #36897]
- Log statements depicting what files will be used by the server now occur
...
...
common/parse.c
View file @
71d7e9aa
...
...
@@ -72,11 +72,18 @@ struct enumeration_value *find_enumeration_value (const char *name,
}
/* Skip to the semicolon ending the current statement. If we encounter
braces, the matching closing brace terminates the statement. If we
encounter a right brace but haven't encountered a left brace, return
leaving the brace in the token buffer for the caller. If we see a
semicolon and haven't seen a left brace, return. This lets us skip
over:
braces, the matching closing brace terminates the statement.
*/
void
skip_to_semi
(
cfile
)
struct
parse
*
cfile
;
{
skip_to_rbrace
(
cfile
,
0
);
}
/* Skips everything from the current point upto (and including) the given
number of right braces. If we encounter a semicolon but haven't seen a
left brace, consume it and return.
This lets us skip over:
statement;
statement foo bar { }
...
...
@@ -84,13 +91,6 @@ struct enumeration_value *find_enumeration_value (const char *name,
statement}
...et cetera. */
void
skip_to_semi
(
cfile
)
struct
parse
*
cfile
;
{
skip_to_rbrace
(
cfile
,
0
);
}
void
skip_to_rbrace
(
cfile
,
brace_count
)
struct
parse
*
cfile
;
int
brace_count
;
...
...
@@ -99,30 +99,36 @@ void skip_to_rbrace (cfile, brace_count)
const
char
*
val
;
#if defined (DEBUG_TOKEN)
log_error
(
"skip_to_rbrace: %d
\n
"
,
brace_count
);
log_error
(
"skip_to_rbrace: %d
\n
"
,
brace_count
);
#endif
do
{
token
=
peek_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
token
=
peek_token
(
&
val
,
NULL
,
cfile
);
if
(
token
==
RBRACE
)
{
skip_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
if
(
brace_count
)
{
if
(
!--
brace_count
)
return
;
}
else
if
(
brace_count
>
0
)
{
--
brace_count
;
}
if
(
brace_count
==
0
)
{
/* Eat the brace and return. */
skip_token
(
&
val
,
NULL
,
cfile
);
return
;
}
}
else
if
(
token
==
LBRACE
)
{
brace_count
++
;
}
else
if
(
token
==
SEMI
&&
!
brace_count
)
{
skip_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
}
else
if
(
token
==
SEMI
&&
(
brace_count
==
0
))
{
/* Eat the semicolon and return. */
skip_token
(
&
val
,
NULL
,
cfile
);
return
;
}
else
if
(
token
==
EOL
)
{
/* EOL only happens when parsing /etc/resolv.conf,
and we treat it like a semicolon because the
resolv.conf file is line-oriented. */
skip_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
skip_token
(
&
val
,
NULL
,
cfile
);
return
;
}
token
=
next_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
/* Eat the current token */
token
=
next_token
(
&
val
,
NULL
,
cfile
);
}
while
(
token
!=
END_OF_FILE
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment