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:05:40 -0800 |
| commit | 21a0677462539d9e94564c71eb8c2a34b1fb2b8d (patch) | |
| tree | acfe72aeb87e67dcd3212f33fe19aeca3daab364 | |
| parent | 3c6ecbd617d8d187f6963b5a43dc1abe5efae12b (diff) | |
| download | nng-21a0677462539d9e94564c71eb8c2a34b1fb2b8d.tar.gz nng-21a0677462539d9e94564c71eb8c2a34b1fb2b8d.tar.bz2 nng-21a0677462539d9e94564c71eb8c2a34b1fb2b8d.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; |
