From 3a374eaeebb6aab0302653d048d08707c1ecd17c Mon Sep 17 00:00:00 2001 From: William Lallemand Date: Tue, 27 Sep 2022 14:31:37 +0200 Subject: [PATCH] BUG/MINOR: ring: fix the size check in ring_make_from_area() Fix the size check in ring_make_from_area() which is checking the size of the pointer instead of the size of the structure. No backport needed, 2.7 only. --- src/ring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ring.c b/src/ring.c index 089a2fc9f..da987c5d5 100644 --- a/src/ring.c +++ b/src/ring.c @@ -85,7 +85,7 @@ struct ring *ring_make_from_area(void *area, size_t size) { struct ring *ring = NULL; - if (size < sizeof(ring)) + if (size < sizeof(*ring)) return NULL; if (!area)