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
4c675334
Commit
4c675334
authored
Feb 07, 2016
by
Pieter Hintjens
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1777 from brian-peloton/master
Use memcpy instead of assuming option values are aligned
parents
ffe4a1c6
273b5471
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
5 deletions
+10
-5
dealer.cpp
src/dealer.cpp
+2
-1
options.cpp
src/options.cpp
+2
-1
req.cpp
src/req.cpp
+2
-1
router.cpp
src/router.cpp
+2
-1
stream.cpp
src/stream.cpp
+2
-1
No files found.
src/dealer.cpp
View file @
4c675334
...
...
@@ -70,7 +70,8 @@ int zmq::dealer_t::xsetsockopt (int option_, const void *optval_,
size_t
optvallen_
)
{
bool
is_int
=
(
optvallen_
==
sizeof
(
int
));
int
value
=
is_int
?
*
((
int
*
)
optval_
)
:
0
;
int
value
=
0
;
if
(
is_int
)
memcpy
(
&
value
,
optval_
,
sizeof
(
int
));
switch
(
option_
)
{
case
ZMQ_PROBE_ROUTER
:
...
...
src/options.cpp
View file @
4c675334
...
...
@@ -92,7 +92,8 @@ int zmq::options_t::setsockopt (int option_, const void *optval_,
size_t
optvallen_
)
{
bool
is_int
=
(
optvallen_
==
sizeof
(
int
));
int
value
=
is_int
?
*
((
int
*
)
optval_
)
:
0
;
int
value
=
0
;
if
(
is_int
)
memcpy
(
&
value
,
optval_
,
sizeof
(
int
));
#if defined (ZMQ_ACT_MILITANT)
bool
malformed
=
true
;
// Did caller pass a bad option value?
#endif
...
...
src/req.cpp
View file @
4c675334
...
...
@@ -204,7 +204,8 @@ bool zmq::req_t::xhas_out ()
int
zmq
::
req_t
::
xsetsockopt
(
int
option_
,
const
void
*
optval_
,
size_t
optvallen_
)
{
bool
is_int
=
(
optvallen_
==
sizeof
(
int
));
int
value
=
is_int
?
*
((
int
*
)
optval_
)
:
0
;
int
value
=
0
;
if
(
is_int
)
memcpy
(
&
value
,
optval_
,
sizeof
(
int
));
switch
(
option_
)
{
case
ZMQ_REQ_CORRELATE
:
...
...
src/router.cpp
View file @
4c675334
...
...
@@ -97,7 +97,8 @@ int zmq::router_t::xsetsockopt (int option_, const void *optval_,
size_t
optvallen_
)
{
bool
is_int
=
(
optvallen_
==
sizeof
(
int
));
int
value
=
is_int
?
*
((
int
*
)
optval_
)
:
0
;
int
value
=
0
;
if
(
is_int
)
memcpy
(
&
value
,
optval_
,
sizeof
(
int
));
switch
(
option_
)
{
case
ZMQ_CONNECT_RID
:
...
...
src/stream.cpp
View file @
4c675334
...
...
@@ -178,7 +178,8 @@ int zmq::stream_t::xsetsockopt (int option_, const void *optval_,
size_t
optvallen_
)
{
bool
is_int
=
(
optvallen_
==
sizeof
(
int
));
int
value
=
is_int
?
*
((
int
*
)
optval_
)
:
0
;
int
value
=
0
;
if
(
is_int
)
memcpy
(
&
value
,
optval_
,
sizeof
(
int
));
switch
(
option_
)
{
case
ZMQ_CONNECT_RID
:
...
...
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