Merge pull request #476 from hurtonm/master

Check decoder's state function for NULL before calling it
This commit is contained in:
Pieter Hintjens 2012-11-21 14:15:59 -08:00
commit a28322cd0c

View File

@ -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)))