diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/transport/ipc/ipc.c | 2 | ||||
| -rw-r--r-- | src/transport/tcp/tcp.c | 2 | ||||
| -rw-r--r-- | src/transport/tls/tls.c | 2 | ||||
| -rw-r--r-- | src/transport/zerotier/zerotier.c | 3 |
4 files changed, 5 insertions, 4 deletions
diff --git a/src/transport/ipc/ipc.c b/src/transport/ipc/ipc.c index e5f3d533..c91606c6 100644 --- a/src/transport/ipc/ipc.c +++ b/src/transport/ipc/ipc.c @@ -302,7 +302,7 @@ nni_ipc_pipe_recv_cb(void *arg) // Make sure the message payload is not too big. If it is // the caller will shut down the pipe. - if (len > pipe->rcvmax) { + if ((len > pipe->rcvmax) && (pipe->rcvmax > 0)) { rv = NNG_EMSGSIZE; goto recv_error; } diff --git a/src/transport/tcp/tcp.c b/src/transport/tcp/tcp.c index d7920f72..3d738a98 100644 --- a/src/transport/tcp/tcp.c +++ b/src/transport/tcp/tcp.c @@ -299,7 +299,7 @@ nni_tcp_pipe_recv_cb(void *arg) // Make sure the message payload is not too big. If it is // the caller will shut down the pipe. - if (len > p->rcvmax) { + if ((len > p->rcvmax) && (p->rcvmax > 0)) { rv = NNG_EMSGSIZE; goto recv_error; } diff --git a/src/transport/tls/tls.c b/src/transport/tls/tls.c index 73d1a29b..78fdd622 100644 --- a/src/transport/tls/tls.c +++ b/src/transport/tls/tls.c @@ -307,7 +307,7 @@ nni_tls_pipe_recv_cb(void *arg) // Make sure the message payload is not too big. If it is // the caller will shut down the pipe. - if (len > p->rcvmax) { + if ((len > p->rcvmax) && (p->rcvmax > 0)) { rv = NNG_EMSGSIZE; goto recv_error; } diff --git a/src/transport/zerotier/zerotier.c b/src/transport/zerotier/zerotier.c index 05866cfb..73cddf7d 100644 --- a/src/transport/zerotier/zerotier.c +++ b/src/transport/zerotier/zerotier.c @@ -921,7 +921,8 @@ zt_pipe_recv_data(zt_pipe *p, const uint8_t *data, size_t len) if (fragno == (nfrags - 1)) { // Last frag, maybe shorten the message. nni_msg_chop(fl->fl_msg, (fragsz - len)); - if (nni_msg_len(fl->fl_msg) > p->zp_rcvmax) { + if ((nni_msg_len(fl->fl_msg) > p->zp_rcvmax) && + (p->zp_rcvmax > 0)) { // Strict enforcement of max recv. zt_fraglist_clear(fl); // Just discard the message. |
