diff --git a/src/hash.rs b/src/hash.rs index f574ef2..aa37060 100644 --- a/src/hash.rs +++ b/src/hash.rs @@ -256,8 +256,9 @@ impl<'data, E: EndianParse> GnuHashTable<'data, E> { symtab: &SymbolTable<'data, E>, strtab: &StringTable<'data>, ) -> Result, 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); }