Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
D
Dnsmasq
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
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
nanahira
Dnsmasq
Commits
a2bc254b
Commit
a2bc254b
authored
Apr 21, 2016
by
Simon Kelley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check return-code of inet_pton when parsing DHCPv4 options.
parent
a7b27e84
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
CHANGELOG
CHANGELOG
+5
-0
src/option.c
src/option.c
+4
-3
No files found.
CHANGELOG
View file @
a2bc254b
...
@@ -56,6 +56,11 @@ version 2.76
...
@@ -56,6 +56,11 @@ version 2.76
Add --tftp-mtu option. Thanks to Patrick McLean for the
Add --tftp-mtu option. Thanks to Patrick McLean for the
initial patch.
initial patch.
Check return-code of inet_pton() when parsing dhcp-option.
Bad addresses could fail to generate errors and result in
garbage dhcp-options being sent. Thanks to Marc Branchaud
for spotting this.
version 2.75
version 2.75
Fix reversion on 2.74 which caused 100% CPU use when a
Fix reversion on 2.74 which caused 100% CPU use when a
...
...
src/option.c
View file @
a2bc254b
...
@@ -1199,7 +1199,8 @@ static int parse_dhcp_opt(char *errstr, char *arg, int flags)
...
@@ -1199,7 +1199,8 @@ static int parse_dhcp_opt(char *errstr, char *arg, int flags)
cp
=
comma
;
cp
=
comma
;
comma
=
split
(
cp
);
comma
=
split
(
cp
);
slash
=
split_chr
(
cp
,
'/'
);
slash
=
split_chr
(
cp
,
'/'
);
inet_pton
(
AF_INET
,
cp
,
&
in
);
if
(
!
inet_pton
(
AF_INET
,
cp
,
&
in
))
ret_err
(
_
(
"bad IPv4 address"
));
if
(
!
slash
)
if
(
!
slash
)
{
{
memcpy
(
op
,
&
in
,
INADDRSZ
);
memcpy
(
op
,
&
in
,
INADDRSZ
);
...
@@ -3658,8 +3659,8 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
...
@@ -3658,8 +3659,8 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
(
!
(
inet_pton
(
AF_INET
,
a
[
1
],
&
new
->
out
)
>
0
)))
(
!
(
inet_pton
(
AF_INET
,
a
[
1
],
&
new
->
out
)
>
0
)))
option
=
'?'
;
option
=
'?'
;
if
(
k
==
3
)
if
(
k
==
3
&&
!
inet_pton
(
AF_INET
,
a
[
2
],
&
new
->
mask
)
)
inet_pton
(
AF_INET
,
a
[
2
],
&
new
->
mask
)
;
option
=
'?'
;
if
(
dash
&&
if
(
dash
&&
(
!
(
inet_pton
(
AF_INET
,
dash
,
&
new
->
end
)
>
0
)
||
(
!
(
inet_pton
(
AF_INET
,
dash
,
&
new
->
end
)
>
0
)
||
...
...
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