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
6a3c053a
Commit
6a3c053a
authored
Aug 22, 2017
by
sigiesec
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Problem: EFAULT is returned for bad file descriptors passed to zmq_poller_*_fd
Solution: Return EBADF instead
parent
74303b08
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
zmq.cpp
src/zmq.cpp
+3
-3
test_poller.cpp
tests/test_poller.cpp
+3
-3
No files found.
src/zmq.cpp
View file @
6a3c053a
...
...
@@ -1270,7 +1270,7 @@ int zmq_poller_add_fd (void *poller_, int fd_, void *user_data_, short events_)
return
-
1
;
}
if
(
fd_
==
zmq
::
retired_fd
)
{
errno
=
E
NOTSOCK
;
errno
=
E
BADF
;
return
-
1
;
}
...
...
@@ -1306,7 +1306,7 @@ int zmq_poller_modify_fd (void *poller_, int fd_, short events_)
return
-
1
;
}
if
(
fd_
==
zmq
::
retired_fd
)
{
errno
=
E
NOTSOCK
;
errno
=
E
BADF
;
return
-
1
;
}
...
...
@@ -1341,7 +1341,7 @@ int zmq_poller_remove_fd (void *poller_, int fd_)
return
-
1
;
}
if
(
fd_
==
zmq
::
retired_fd
)
{
errno
=
E
NOTSOCK
;
errno
=
E
BADF
;
return
-
1
;
}
...
...
tests/test_poller.cpp
View file @
6a3c053a
...
...
@@ -121,13 +121,13 @@ void test_null_socket_pointers ()
fd_t
null_socket_fd
=
retired_fd
;
rc
=
zmq_poller_add_fd
(
poller
,
null_socket_fd
,
NULL
,
ZMQ_POLLIN
);
assert
(
rc
==
-
1
&&
errno
==
E
NOTSOCK
);
assert
(
rc
==
-
1
&&
errno
==
E
BADF
);
rc
=
zmq_poller_modify_fd
(
poller
,
null_socket_fd
,
ZMQ_POLLIN
);
assert
(
rc
==
-
1
&&
errno
==
E
NOTSOCK
);
assert
(
rc
==
-
1
&&
errno
==
E
BADF
);
rc
=
zmq_poller_remove_fd
(
poller
,
null_socket_fd
);
assert
(
rc
==
-
1
&&
errno
==
E
NOTSOCK
);
assert
(
rc
==
-
1
&&
errno
==
E
BADF
);
rc
=
zmq_poller_destroy
(
&
poller
);
assert
(
rc
==
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