From: William Lallemand Date: Tue, 27 Sep 2022 12:31:37 +0000 (+0200) Subject: BUG/MINOR: ring: fix the size check in ring_make_from_area() X-Git-Tag: v2.7-dev7~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3a374eaeebb6aab0302653d048d08707c1ecd17c;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/src/ring.c b/src/ring.c index 089a2fc9f0..da987c5d5f 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)