zmq_sendmsg and zmq_recvmsg checks for NULL message object

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
This commit is contained in:
Martin Sustrik 2011-12-16 07:04:38 +01:00
parent 3fb5c11b03
commit f9eb763293

View File

@ -475,7 +475,7 @@ int zmq::socket_base_t::send (msg_t *msg_, int flags_)
}
// Check whether message passed to the function is valid.
if (unlikely (!msg_->check ())) {
if (unlikely (!msg_ || !msg_->check ())) {
errno = EFAULT;
return -1;
}
@ -541,7 +541,7 @@ int zmq::socket_base_t::recv (msg_t *msg_, int flags_)
}
// Check whether message passed to the function is valid.
if (unlikely (!msg_->check ())) {
if (unlikely (!msg_ || !msg_->check ())) {
errno = EFAULT;
return -1;
}