aboutsummaryrefslogtreecommitdiffstats
path: root/src/vppinfra
diff options
context:
space:
mode:
authorAndreas Schultz <andreas.schultz@travelping.com>2019-07-19 11:14:50 +0200
committerDave Barach <openvpp@barachs.net>2019-07-19 14:29:39 +0000
commitb4b525e0fa14d46eac4c2f44048c0488c83f0192 (patch)
tree704ba4059126c67cc27cdcd2c282058edda401c7 /src/vppinfra
parent675c2396a14ffbe1b5f1de59943161625a10c280 (diff)
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>
Diffstat (limited to 'src/vppinfra')
-rw-r--r--src/vppinfra/bihash_template.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vppinfra/bihash_template.c b/src/vppinfra/bihash_template.c
index cd75a7a9be9..11e3ac448f8 100644
--- a/src/vppinfra/bihash_template.c
+++ b/src/vppinfra/bihash_template.c
@@ -26,7 +26,7 @@ static inline void *BV (alloc_aligned) (BVT (clib_bihash) * h, uword nbytes)
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));