diff options
| author | Garrett D'Amore <garrett@damore.org> | 2020-01-12 23:01:53 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2020-01-12 23:03:06 -0800 |
| commit | 4299a5b4edc59753a6ec857fabedadf1504c4243 (patch) | |
| tree | d87ad9fad65cd2dd7a842b6983884f734c22e1e1 | |
| parent | 5521b6e501c478a6113d6db8424bd89fb612763e (diff) | |
| download | nng-4299a5b4edc59753a6ec857fabedadf1504c4243.tar.gz nng-4299a5b4edc59753a6ec857fabedadf1504c4243.tar.bz2 nng-4299a5b4edc59753a6ec857fabedadf1504c4243.zip | |
fixes #1132 Masking error in LMQ leads to corruption
| -rw-r--r-- | src/core/lmq.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/lmq.c b/src/core/lmq.c index 9772e78e..bbf42356 100644 --- a/src/core/lmq.c +++ b/src/core/lmq.c @@ -1,5 +1,5 @@ // -// Copyright 2019 Staysail Systems, Inc. <info@staysail.tech> +// Copyright 2020 Staysail Systems, Inc. <info@staysail.tech> // // This software is supplied under the terms of the MIT License, a // copy of which should be located in the distribution where this @@ -32,7 +32,7 @@ nni_lmq_init(nni_lmq *lmq, size_t cap) } lmq->lmq_cap = cap; lmq->lmq_alloc = alloc; - lmq->lmq_mask = (cap - 1); + lmq->lmq_mask = (alloc - 1); lmq->lmq_len = 0; lmq->lmq_get = 0; lmq->lmq_put = 0; |
