Commit a8721c3c authored by Martin Hurton's avatar Martin Hurton

Check decoder's state function for NULL before calling it

Fixes bug reported by Peter Friend
(http://lists.zeromq.org/pipermail/zeromq-dev/2012-November/019425.html)
parent 8db8c45b
......@@ -148,6 +148,10 @@ namespace zmq
// False is returned if the decoder has encountered an error.
bool stalled ()
{
// Check whether there was decoding error.
if (unlikely (static_cast <T*> (this)->next == NULL))
return false;
while (!to_read) {
if (!(static_cast <T*> (this)->*next) ()) {
if (unlikely (!(static_cast <T*> (this)->next)))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment