From f9eb763293014f812dac5558be5c5f03bb896efb Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Fri, 16 Dec 2011 07:04:38 +0100 Subject: zmq_sendmsg and zmq_recvmsg checks for NULL message object Signed-off-by: Martin Sustrik --- src/socket_base.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/socket_base.cpp') diff --git a/src/socket_base.cpp b/src/socket_base.cpp index 302003f..7293419 100644 --- a/src/socket_base.cpp +++ b/src/socket_base.cpp @@ -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; } -- cgit v1.2.3