diff options
Diffstat (limited to 'libctf/ctf-hash.c')
-rw-r--r-- | libctf/ctf-hash.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libctf/ctf-hash.c b/libctf/ctf-hash.c index 12bd6ef..3512d22 100644 --- a/libctf/ctf-hash.c +++ b/libctf/ctf-hash.c @@ -271,16 +271,18 @@ int ctf_hash_insert_type (ctf_hash_t *hp, ctf_file_t *fp, uint32_t type, uint32_t name) { - ctf_strs_t *ctsp = &fp->ctf_str[CTF_NAME_STID (name)]; - const char *str = ctsp->cts_strs + CTF_NAME_OFFSET (name); + const char *str = ctf_strraw (fp, name); if (type == 0) return EINVAL; - if (ctsp->cts_strs == NULL) + if (str == NULL + && CTF_NAME_STID (name) == CTF_STRTAB_1 + && fp->ctf_syn_ext_strtab == NULL + && fp->ctf_str[CTF_NAME_STID (name)].cts_strs == NULL) return ECTF_STRTAB; - if (ctsp->cts_len <= CTF_NAME_OFFSET (name)) + if (str == NULL) return ECTF_BADNAME; if (str[0] == '\0') |