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
1beb54ce
Commit
1beb54ce
authored
Jun 17, 2014
by
Pieter Hintjens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added militant API checking on zmq_getsockopt
parent
d0667461
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
options.cpp
src/options.cpp
+14
-0
No files found.
src/options.cpp
View file @
1beb54ce
...
...
@@ -68,6 +68,7 @@ int zmq::options_t::setsockopt (int option_, const void *optval_,
#if defined (ZMQ_ACT_MILITANT)
bool
malformed
=
true
;
// Did caller pass a bad option value?
#endif
switch
(
option_
)
{
case
ZMQ_SNDHWM
:
if
(
is_int
&&
value
>=
0
)
{
...
...
@@ -467,6 +468,9 @@ int zmq::options_t::getsockopt (int option_, void *optval_, size_t *optvallen_)
{
bool
is_int
=
(
*
optvallen_
==
sizeof
(
int
));
int
*
value
=
(
int
*
)
optval_
;
#if defined (ZMQ_ACT_MILITANT)
bool
malformed
=
true
;
// Did caller pass a bad option value?
#endif
switch
(
option_
)
{
case
ZMQ_SNDHWM
:
...
...
@@ -773,7 +777,17 @@ int zmq::options_t::getsockopt (int option_, void *optval_, size_t *optvallen_)
return
0
;
}
break
;
default
:
#if defined (ZMQ_ACT_MILITANT)
malformed
=
false
;
#endif
break
;
}
#if defined (ZMQ_ACT_MILITANT)
if
(
malformed
)
zmq_assert
(
false
);
#endif
errno
=
EINVAL
;
return
-
1
;
}
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