diff options
| author | Domingo Alvarez Duarte <mingodad@gmail.com> | 2013-01-31 12:05:11 +0100 |
|---|---|---|
| committer | Thomas Preud'homme <robotux@celest.fr> | 2013-01-31 12:07:20 +0100 |
| commit | 505329b5b3ee4cb47d0a3590ccd62a65dbf83fc9 (patch) | |
| tree | d0266c219422adcdd5609f5c91ffbf6f6c28828c /tccelf.c | |
| parent | 93785149ed61b7165510ff30149f297cf0821c88 (diff) | |
| download | tinycc-505329b5b3ee4cb47d0a3590ccd62a65dbf83fc9.tar.gz tinycc-505329b5b3ee4cb47d0a3590ccd62a65dbf83fc9.tar.bz2 | |
Don't call elf_hash on NULL value
Make sur elf_hash is never invoked with a NULL value.
Signed-off-by: Thomas Preud'homme <robotux@celest.fr>
Diffstat (limited to 'tccelf.c')
| -rw-r--r-- | tccelf.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -114,7 +114,7 @@ ST_FUNC int put_elf_sym(Section *s, uplong value, unsigned long size, if (ELFW(ST_BIND)(info) != STB_LOCAL) { /* add another hashing entry */ nbuckets = base[0]; - h = elf_hash(name) % nbuckets; + h = name ? elf_hash(name) % nbuckets : 0; *ptr = base[2 + h]; base[2 + h] = sym_index; base[1]++; |
