mirror of
https://github.com/zeromq/libzmq.git
synced 2025-11-03 19:40:39 +01:00
Problem: zmq_poller_destroy parameter checking
Solution: - Add checks for **poller_p_ to ensure that we do not segfault when either it or the value within it are NULL - Add tests for the above and increase error state coverage
This commit is contained in:
@@ -1110,8 +1110,9 @@ void *zmq_poller_new (void)
|
||||
|
||||
int zmq_poller_destroy (void **poller_p_)
|
||||
{
|
||||
void *poller = *poller_p_;
|
||||
if (!poller || !((zmq::socket_poller_t*) poller)->check_tag ()) {
|
||||
void *poller;
|
||||
if (!poller_p_ || !(poller = *poller_p_) ||
|
||||
!((zmq::socket_poller_t*) poller)->check_tag ()) {
|
||||
errno = EFAULT;
|
||||
return -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user