>From f9eb763293014f812dac5558be5c5f03bb896efb Mon Sep 17 00:00:00 2001
From: Martin Sustrik <[email protected]>
Date: Fri, 16 Dec 2011 07:04:38 +0100
Subject: [PATCH] zmq_sendmsg and zmq_recvmsg checks for NULL message object

Signed-off-by: Martin Sustrik <[email protected]>
---
 src/socket_base.cpp |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

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;
     }
-- 
1.7.4.1

_______________________________________________
zeromq-dev mailing list
[email protected]
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to