summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2010-12-20 11:47:41 +0100
committerMartin Sustrik <sustrik@250bpm.com>2010-12-20 11:47:41 +0100
commit112d0cd52ec959a6bb4cf02ab03977bc22478246 (patch)
tree1bd53a54a364f29cc3939fede94e71ff9cc29b2b /src
parentcbbb1e925d699c8b42b2724740d68839c81684c3 (diff)
Fix the segfault when over-sized message is rejected.
The in_progress message inside of decoder was left uninitialised in such a case. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Diffstat (limited to 'src')
-rw-r--r--src/decoder.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/decoder.cpp b/src/decoder.cpp
index 5ca2a93..0b2a806 100644
--- a/src/decoder.cpp
+++ b/src/decoder.cpp
@@ -92,6 +92,8 @@ bool zmq::decoder_t::eight_byte_size_ready ()
// message and thus we can treat it as uninitialised...
int rc = zmq_msg_init_size (&in_progress, size - 1);
if (rc != 0 && errno == ENOMEM) {
+ rc = zmq_msg_init (&in_progress);
+ errno_assert (rc == 0);
decoding_error ();
return false;
}