vppinfra: fix OOM check in bihash
The OOM check must consider the end of alloced arena and
not the start when checking for overflow.
Type: fix
Change-Id: Ie83e653d0894199d2fa433a604a0fe0cee142338
Signed-off-by: Andreas Schultz <andreas.schultz@travelping.com>
diff --git a/src/vppinfra/bihash_template.c b/src/vppinfra/bihash_template.c
index cd75a7a..11e3ac4 100644
--- a/src/vppinfra/bihash_template.c
+++ b/src/vppinfra/bihash_template.c
@@ -26,7 +26,7 @@
rv = alloc_arena_next (h);
alloc_arena_next (h) += nbytes;
- if (rv >= alloc_arena_size (h))
+ if (alloc_arena_next (h) > alloc_arena_size (h))
os_out_of_memory ();
return (void *) (uword) (rv + alloc_arena (h));