summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/sub.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/sub.cpp b/src/sub.cpp
index ad55ea3..94bb20d 100644
--- a/src/sub.cpp
+++ b/src/sub.cpp
@@ -44,6 +44,11 @@ int xs::sub_t::xsetsockopt (int option_, const void *optval_,
return -1;
}
+ if (optvallen_ > 0 && !optval_) {
+ errno = EFAULT;
+ return -1;
+ }
+
// Create the subscription message.
msg_t msg;
int rc = msg.init_size (optvallen_ + 1);