From 21a0677462539d9e94564c71eb8c2a34b1fb2b8d Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sun, 12 Jan 2020 23:01:53 -0800 Subject: fixes #1132 Masking error in LMQ leads to corruption --- src/core/lmq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') 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. +// Copyright 2020 Staysail Systems, Inc. // // 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; -- cgit v1.2.3-70-g09d2