return None if nbloom is zero to avoid potential overflows in malformed gnu hash headers
This commit is contained in:
parent
1ed0bdd654
commit
9192854af5
@ -256,8 +256,9 @@ impl<'data, E: EndianParse> GnuHashTable<'data, E> {
|
||||
symtab: &SymbolTable<'data, E>,
|
||||
strtab: &StringTable<'data>,
|
||||
) -> Result<Option<(usize, Symbol)>, ParseError> {
|
||||
// empty hash tables don't have any entries. This avoids a divde by zero in the modulus calculation
|
||||
if self.buckets.is_empty() {
|
||||
// empty hash tables don't have any entries. This avoids a divde by zero in the modulus calculation,
|
||||
// and also avoids a potential overflow in the bloom filter calculation.
|
||||
if self.buckets.is_empty() || self.hdr.nbloom == 0 {
|
||||
return Ok(None);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user