Permalink
Browse files

zmq_sendmsg and zmq_recvmsg checks for NULL message object

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
  • Loading branch information...
1 parent 3fb5c11 commit f9eb763293014f812dac5558be5c5f03bb896efb @sustrik sustrik committed Dec 16, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/socket_base.cpp
View
@@ -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;
}

0 comments on commit f9eb763

Please sign in to comment.