diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-01-22 21:26:45 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-01-22 21:26:45 +0000 |
commit | 49889a296e9e15077b36917329538e154789dd9f (patch) | |
tree | dd3fbde6f7046506c0ca58f5949a07111fe077b3 /sal/rtl/alloc_arena.cxx | |
parent | f5cf7cfecd12fdcb2168026b6867b7f39d100fb3 (diff) |
coverity#1399029 silence Out-of-bounds read
Change-Id: I025e416a6a162316d82cfbde9fbfcb0a45e888d5
Diffstat (limited to 'sal/rtl/alloc_arena.cxx')
-rw-r--r-- | sal/rtl/alloc_arena.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sal/rtl/alloc_arena.cxx b/sal/rtl/alloc_arena.cxx index 19bc4241b3b0..68dd29836ef5 100644 --- a/sal/rtl/alloc_arena.cxx +++ b/sal/rtl/alloc_arena.cxx @@ -217,8 +217,9 @@ rtl_arena_freelist_insert ( ) { rtl_arena_segment_type * head; - - head = &(arena->m_freelist_head[highbit(segment->m_size) - 1]); + const auto bit = highbit(segment->m_size); + assert(bit > 0); + head = &(arena->m_freelist_head[bit - 1]); QUEUE_INSERT_TAIL_NAMED(head, segment, f); arena->m_freelist_bitmap |= head->m_size; |