diff options
| author | Garrett D'Amore <garrett@damore.org> | 2018-04-04 11:07:56 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2018-04-04 11:07:56 -0700 |
| commit | 505a9bce029e51540739c853a6c9eef0ecfb2e90 (patch) | |
| tree | d907679b6ab99bcb5da919db3d005d4976590c21 /src/transport/ipc | |
| parent | 0aa1de1316b46bb4af23fdf26759bca08008eaf5 (diff) | |
| download | nng-505a9bce029e51540739c853a6c9eef0ecfb2e90.tar.gz nng-505a9bce029e51540739c853a6c9eef0ecfb2e90.tar.bz2 nng-505a9bce029e51540739c853a6c9eef0ecfb2e90.zip | |
fixes #329 type checking not done for setopt
Diffstat (limited to 'src/transport/ipc')
| -rw-r--r-- | src/transport/ipc/ipc.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/transport/ipc/ipc.c b/src/transport/ipc/ipc.c index 98d3f177..ecc9a962 100644 --- a/src/transport/ipc/ipc.c +++ b/src/transport/ipc/ipc.c @@ -719,14 +719,17 @@ nni_ipc_ep_connect(void *arg, nni_aio *aio) } static int -nni_ipc_ep_setopt_recvmaxsz(void *arg, const void *data, size_t sz) +nni_ipc_ep_setopt_recvmaxsz(void *arg, const void *data, size_t sz, int typ) { nni_ipc_ep *ep = arg; + size_t val; + int rv; - if (ep == NULL) { - return (nni_chkopt_size(data, sz, 0, NNI_MAXSZ)); + rv = nni_copyin_size(&val, data, sz, 0, NNI_MAXSZ, typ); + if ((rv == 0) && (ep != NULL)) { + ep->rcvmax = val; } - return (nni_setopt_size(&ep->rcvmax, data, sz, 0, NNI_MAXSZ)); + return (rv); } static int |
