From e5bd4c0309bfcdbcf5b7d1ace8605e942954ce9f Mon Sep 17 00:00:00 2001 From: Samy Al Bahra Date: Mon, 12 Aug 2019 22:35:18 -0400 Subject: [PATCH] ck_ring: ck_ring_valid should reject wrap-around. --- include/ck_ring.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/ck_ring.h b/include/ck_ring.h index 33d1ad1..9f6754e 100644 --- a/include/ck_ring.h +++ b/include/ck_ring.h @@ -110,7 +110,7 @@ ck_ring_valid(const struct ck_ring *ring) return false; /* The producer may only be up to size slots ahead of consumer. */ - if (p_head - c_head > size) + if (p_head - c_head >= size) return false; return true;