From 796212a985964162a284cc667ab09834ce681466 Mon Sep 17 00:00:00 2001 From: Martin Hurton Date: Sat, 9 Jun 2012 12:52:26 +0200 Subject: [PATCH] Fix the message decoder to ignore reserved flags. Failing to clear the reserved flags, the decoder may produce messages with 'identity' and 'shared' flags set. This unintended modification of message flags can lead to memory errors or asserion failures. Fixes issue #309 --- src/decoder.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/decoder.cpp b/src/decoder.cpp index 06fb35b7..6368c77c 100644 --- a/src/decoder.cpp +++ b/src/decoder.cpp @@ -145,7 +145,7 @@ bool zmq::decoder_t::eight_byte_size_ready () bool zmq::decoder_t::flags_ready () { // Store the flags from the wire into the message structure. - in_progress.set_flags (tmpbuf [0]); + in_progress.set_flags (tmpbuf [0] & msg_t::more); next_step (in_progress.data (), in_progress.size (), &decoder_t::message_ready);