Skip to content

Commit

Permalink
Problem: use-after-free in test_poller
Browse files Browse the repository at this point in the history
Solution: remove server socket from poller before closing it
Fixes zeromq#2581
  • Loading branch information
bluca committed May 18, 2017
1 parent bc8ad88 commit 1763753
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/test_poller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,10 @@ int main (void)
assert (event.socket == server);
assert (event.user_data == NULL);
assert (event.events == ZMQ_POLLOUT);

// Stop polling server
rc = zmq_poller_remove (poller, server);
assert (rc == 0);
#endif

// Destory sockets, poller and ctx
Expand Down

0 comments on commit 1763753

Please sign in to comment.