summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2010-09-15 16:58:00 +0200
committerMartin Sustrik <sustrik@250bpm.com>2010-09-15 16:58:00 +0200
commitff1080728f3a587ee472a64533fd7e44b365e6f0 (patch)
tree7af6a071ce5b5dff5d0436c56cd8dfdd21b4ca41
parentbe159b63169474b644ebd38177bf4e808ebb5487 (diff)
parente2802d9a4b7e518c549e8dd95a34d2424058f086 (diff)
Merge branch 'maint'
* maint: values of RATE, RECOVERY_IVL and SWAP options are checked for negative values
-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;
}