From 860e1d24c08c82c0dea2b8cee5af44ec3837deac Mon Sep 17 00:00:00 2001 From: Pieter Hintjens Date: Wed, 21 Mar 2012 17:43:52 -0500 Subject: [PATCH] Fixed issue #344 --- src/xrep.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) 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; }