diff options
author | Adam Guthrie <asguthrie@gmail.com> | 2012-04-18 07:21:13 +0200 |
---|---|---|
committer | Martin Sustrik <sustrik@250bpm.com> | 2012-04-18 07:21:13 +0200 |
commit | 4e44fb698044d24217c143e28b618cbcf71d7aa3 (patch) | |
tree | bfc30a4e1a84f7c3afecc7d3e6b3fe9ffa277717 /src | |
parent | 464e0d5ed87f5e0c7fa10d13075e62307eba075f (diff) |
xs_zmq: initialize size in zmq_getsockopt
This fixes a critical bug in zmq_getsockopt.
Diffstat (limited to 'src')
-rw-r--r-- | src/xszmq.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/xszmq.cpp b/src/xszmq.cpp index bac6985..d7199f9 100644 --- a/src/xszmq.cpp +++ b/src/xszmq.cpp @@ -250,7 +250,7 @@ int zmq_getsockopt (void *s, int option, void *optval, return -1; } int val; - size_t size; + size_t size = sizeof (int); int rc = xs_getsockopt (s, option, &val, &size); if (rc < 0) return -1; @@ -267,7 +267,7 @@ int zmq_getsockopt (void *s, int option, void *optval, return -1; } int val; - size_t size; + size_t size = sizeof (int); int rc = xs_getsockopt (s, XS_SNDHWM, &val, &size); if (rc < 0) return -1; @@ -284,7 +284,7 @@ int zmq_getsockopt (void *s, int option, void *optval, return -1; } int val; - size_t size; + size_t size = sizeof (int); int rc = xs_getsockopt (s, option, &val, &size); if (rc < 0) return -1; @@ -302,7 +302,7 @@ int zmq_getsockopt (void *s, int option, void *optval, return -1; } int val; - size_t size; + size_t size = sizeof (int); int rc = xs_getsockopt (s, option, &val, &size); if (rc < 0) return -1; @@ -320,7 +320,7 @@ int zmq_getsockopt (void *s, int option, void *optval, return -1; } int val; - size_t size; + size_t size = sizeof (int); int rc = xs_getsockopt (s, option, &val, &size); if (rc < 0) return -1; @@ -337,7 +337,7 @@ int zmq_getsockopt (void *s, int option, void *optval, return -1; } int val; - size_t size; + size_t size = sizeof (int); int rc = xs_getsockopt (s, option, &val, &size); if (rc < 0) return -1; |