diff --git a/src/xrep.cpp b/src/xrep.cpp index 6e9a1147..a45c51e7 100644 --- a/src/xrep.cpp +++ b/src/xrep.cpp @@ -85,14 +85,11 @@ int zmq::xrep_t::xsetsockopt (int option_, const void *optval_, errno = EINVAL; return -1; } - - if(sizeof(optvallen_) != sizeof(int)) { + if (optvallen_ != sizeof (int) || *((int*) optval_) < 0) { errno = EINVAL; return -1; } - fail_unroutable = *((const int*) optval_); - return 0; }