The function truncate_to_userkey panics if the empty byte vector is used as key. This can be fixed by changing the below > to a >=. The function truncate_to_userkey is called when you have a DBIterator where next() is called.
pub fn truncate_to_userkey(ikey: &mut Vec<u8>) {
let len = ikey.len();
assert!(len > 8);
ikey.truncate(len - 8);
}
Suggested fix: Change src/key_types.rs line 212 to: assert!(len >= 8);
The function
truncate_to_userkey
panics if the empty byte vector is used as key. This can be fixed by changing the below>
to a>=
. The functiontruncate_to_userkey
is called when you have aDBIterator
wherenext()
is called.Suggested fix: Change
src/key_types.rs
line 212 to:assert!(len >= 8);