diff options
Diffstat (limited to 'addr2line.c')
-rw-r--r-- | addr2line.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/addr2line.c b/addr2line.c index 9669427d36..0029cffbca 100644 --- a/addr2line.c +++ b/addr2line.c @@ -437,7 +437,8 @@ parse_debug_line_cu(int num_traces, void **traces, char **debug_line, addr += a; break; case DW_LNS_fixed_advance_pc: - a = *(unsigned char *)p++; + a = *(uint16_t *)p; + p += sizeof(uint16_t); addr += a; break; case DW_LNS_set_prologue_end: @@ -1625,6 +1626,7 @@ debug_info_read(DebugInfoReader *reader, int num_traces, void **traces, static unsigned long uncompress_debug_section(ElfW(Shdr) *shdr, char *file, char **ptr) { + *ptr = NULL; #ifdef SUPPORT_COMPRESSED_DEBUG_LINE ElfW(Chdr) *chdr = (ElfW(Chdr) *)(file + shdr->sh_offset); unsigned long destsize = chdr->ch_size; @@ -1645,6 +1647,7 @@ uncompress_debug_section(ElfW(Shdr) *shdr, char *file, char **ptr) fail: free(*ptr); + *ptr = NULL; #endif return 0; } |