From: Mark Wielaard Date: Wed, 6 May 2015 11:09:23 +0000 (+0200) Subject: elflint: Stop checking section when 2nd hash function shift too big. X-Git-Tag: elfutils-0.162~68 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=16e2ac344788f2bb08ae9dc0a20948f554ca560c;p=thirdparty%2Felfutils.git elflint: Stop checking section when 2nd hash function shift too big. Nothing good comes from trying to continue with a bogus hash function. https://bugzilla.redhat.com/show_bug.cgi?id=1170810#c31 --- diff --git a/src/ChangeLog b/src/ChangeLog index 7a44fc6eb..486f20f1b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2015-05-06 Mark Wielaard + + * elflint.c (check_gnu_hash): Return early when 2nd hash function + shift too big. + 2015-05-05 Mark Wielaard * nm.c (show_symbols): Handle dwarf_linesrc returning NULL. diff --git a/src/elflint.c b/src/elflint.c index a6f9b6881..3abda7186 100644 --- a/src/elflint.c +++ b/src/elflint.c @@ -2115,9 +2115,12 @@ section [%2d] '%s': hash table section is too small (is %ld, expected at least % } if (shift > 31) - ERROR (gettext ("\ + { + ERROR (gettext ("\ section [%2d] '%s': 2nd hash function shift too big: %u\n"), - idx, section_name (ebl, idx), shift); + idx, section_name (ebl, idx), shift); + return; + } size_t maxidx = shdr->sh_size / sizeof (Elf32_Word) - (4 + bitmask_words + nbuckets);