Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
L
libzmq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
libzmq
Commits
a96a87f3
Commit
a96a87f3
authored
May 30, 2018
by
Simon Giesecke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Problem: problematic atoi function is used (CERT ERR-34C)
Solution: use strtol instead
parent
27313774
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
tcp_address.cpp
src/tcp_address.cpp
+2
-2
No files found.
src/tcp_address.cpp
View file @
a96a87f3
...
...
@@ -228,7 +228,7 @@ int zmq::tcp_address_mask_t::resolve (const char *name_, bool ipv6_)
}
else
if
(
mask_str
==
"0"
)
_address_mask
=
0
;
else
{
const
int
mask
=
atoi
(
mask_str
.
c_str
()
);
const
long
mask
=
strtol
(
mask_str
.
c_str
(),
NULL
,
10
);
if
((
mask
<
1
)
||
(
_network_address
.
family
()
==
AF_INET6
&&
mask
>
full_mask_ipv6
)
||
(
_network_address
.
family
()
!=
AF_INET6
...
...
@@ -236,7 +236,7 @@ int zmq::tcp_address_mask_t::resolve (const char *name_, bool ipv6_)
errno
=
EINVAL
;
return
-
1
;
}
_address_mask
=
mask
;
_address_mask
=
static_cast
<
int
>
(
mask
)
;
}
return
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