Commit a28322cd authored by Pieter Hintjens's avatar Pieter Hintjens

Merge pull request #476 from hurtonm/master

Check decoder's state function for NULL before calling it
parents 8db8c45b a8721c3c
......@@ -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