* elf_find_symbol() now checks if the hashtable section is greater than 0.

* Whatever is the cause of #2733, this should at least not make it crash.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28615 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2008-11-11 21:24:09 +00:00
parent 0d1f354d28
commit e6e76e14dd
+3 -6
View File
@@ -523,14 +523,11 @@ void dump_symbol(struct elf_image_info *image, struct Elf32_Sym *sym)
static struct Elf32_Sym *
elf_find_symbol(struct elf_image_info *image, const char *name)
{
uint32 hash;
uint32 i;
if (!image->dynamic_section)
if (image->dynamic_section == 0 || HASHTABSIZE(image) == 0)
return NULL;
hash = elf_hash(name) % HASHTABSIZE(image);
for (i = HASHBUCKETS(image)[hash]; i != STN_UNDEF;
uint32 hash = elf_hash(name) % HASHTABSIZE(image);
for (uint32 i = HASHBUCKETS(image)[hash]; i != STN_UNDEF;
i = HASHCHAINS(image)[i]) {
if (!strcmp(SYMNAME(image, &image->syms[i]), name))
return &image->syms[i];