summaryrefslogtreecommitdiff
path: root/src/options.cpp
diff options
context:
space:
mode:
authorMartin Lucina <mato@kotelna.sk>2010-10-21 16:21:20 +0200
committerMartin Lucina <martin@lucina.net>2012-01-23 08:53:31 +0100
commit3f0085ddbef1a44b6bb7a0b23af497d56e0025fa (patch)
tree0adac3a5b31b2a1d9a89ec5a797f34c1a3fdf27a /src/options.cpp
parent90d73cba9cd1d1724f38ed82fc0eefb1781c9c20 (diff)
parent2c416a793ea781273a5da6742211f5f01af13a2b (diff)
Imported Debian patch 2.0.10-1debian/2.0.10-1
Diffstat (limited to 'src/options.cpp')
-rw-r--r--src/options.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/options.cpp b/src/options.cpp
index f6b24d6..dcbb51d 100644
--- a/src/options.cpp
+++ b/src/options.cpp
@@ -53,7 +53,7 @@ int zmq::options_t::setsockopt (int option_, const void *optval_,
return 0;
case ZMQ_SWAP:
- if (optvallen_ != sizeof (int64_t)) {
+ if (optvallen_ != sizeof (int64_t) || *((int64_t*) optval_) < 0) {
errno = EINVAL;
return -1;
}
@@ -82,7 +82,7 @@ int zmq::options_t::setsockopt (int option_, const void *optval_,
return 0;
case ZMQ_RATE:
- if (optvallen_ != sizeof (int64_t)) {
+ if (optvallen_ != sizeof (int64_t) || *((int64_t*) optval_) < 0) {
errno = EINVAL;
return -1;
}
@@ -90,7 +90,7 @@ int zmq::options_t::setsockopt (int option_, const void *optval_,
return 0;
case ZMQ_RECOVERY_IVL:
- if (optvallen_ != sizeof (int64_t)) {
+ if (optvallen_ != sizeof (int64_t) || *((int64_t*) optval_) < 0) {
errno = EINVAL;
return -1;
}