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.
This commit is contained in:
William Lallemand 2022-09-27 14:31:37 +02:00
parent bb650f2be8
commit 3a374eaeeb

View File

@ -85,7 +85,7 @@ struct ring *ring_make_from_area(void *area, size_t size)
{ {
struct ring *ring = NULL; struct ring *ring = NULL;
if (size < sizeof(ring)) if (size < sizeof(*ring))
return NULL; return NULL;
if (!area) if (!area)