Skip to content

Commit fcba8ed

Browse files
author
dif
committed
[INDEXMAP] do not insert past buffer
1 parent 09d9ab9 commit fcba8ed

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

shared/data_struct/indexmap.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class IndexMap {
3030
}
3131

3232
bool add(const uint32_t index, const T& value) {
33-
if (count >= capacity) return false;
33+
if (count >= capacity || index > capacity) return false;
3434
items[index] = value;
3535
count++;
3636
return true;

0 commit comments

Comments
 (0)