Code Review
/
vpp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
review
|
tree
raw
|
patch
| inline |
side by side
(parent:
675c239
)
vppinfra: fix OOM check in bihash
39/20739/2
author
Andreas Schultz
<andreas.schultz@travelping.com>
Fri, 19 Jul 2019 09:14:50 +0000
(11:14 +0200)
committer
Dave Barach
<openvpp@barachs.net>
Fri, 19 Jul 2019 14:29:39 +0000
(14:29 +0000)
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>
src/vppinfra/bihash_template.c
patch
|
blob
|
history
diff --git
a/src/vppinfra/bihash_template.c
b/src/vppinfra/bihash_template.c
index
cd75a7a
..
11e3ac4
100644
(file)
--- 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));