Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #476 from hurtonm/master

Check decoder's state function for NULL before calling it
  • Loading branch information...
commit a28322cd0cf7a62e4f41d70fa3896a438c23db9d 2 parents 8db8c45 + a8721c3
@hintjens hintjens authored
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/decoder.hpp
View
4 src/decoder.hpp
@@ -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)))
Please sign in to comment.
Something went wrong with that request. Please try again.