mirror of
https://github.com/zeromq/libzmq.git
synced 2024-12-13 10:52:56 +01:00
Problem: inside the event array, epoll return an event with invalid data pointer which create a segmentation fault
Tests to prevent segmentation fault due to null pointer are added.
This commit is contained in:
parent
1d3633742a
commit
2c415b6f68
@ -192,6 +192,10 @@ void zmq::epoll_t::loop ()
|
|||||||
const poll_entry_t *const pe =
|
const poll_entry_t *const pe =
|
||||||
static_cast<const poll_entry_t *> (ev_buf[i].data.ptr);
|
static_cast<const poll_entry_t *> (ev_buf[i].data.ptr);
|
||||||
|
|
||||||
|
if (NULL == pe)
|
||||||
|
continue;
|
||||||
|
if (NULL == pe->events)
|
||||||
|
continue;
|
||||||
if (pe->fd == retired_fd)
|
if (pe->fd == retired_fd)
|
||||||
continue;
|
continue;
|
||||||
if (ev_buf[i].events & (EPOLLERR | EPOLLHUP))
|
if (ev_buf[i].events & (EPOLLERR | EPOLLHUP))
|
||||||
|
Loading…
Reference in New Issue
Block a user