diff options
author | NAKAMURA Usaku <usa@ruby-lang.org> | 2021-11-24 19:31:06 +0900 |
---|---|---|
committer | NAKAMURA Usaku <usa@ruby-lang.org> | 2021-11-24 19:31:06 +0900 |
commit | 0fd9588395294ac97a1f6dc3a51d4f19e84a6ba9 (patch) | |
tree | 5817aea0416ab62e3491efa81750f7c9a7a1e529 /addr2line.c | |
parent | f236548038048118e766232034511e4877a59b49 (diff) |
merge revision(s) d795f494a89e0d9498dfedc54b8a98acc2bc4d7b: [Backport #17794]
Avoid `free(3)`ing invalid pointer
Fixes [Bug #17794]
---
addr2line.c | 2 ++
1 file changed, 2 insertions(+)
Diffstat (limited to 'addr2line.c')
-rw-r--r-- | addr2line.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/addr2line.c b/addr2line.c index 635194b96b..283382f51d 100644 --- a/addr2line.c +++ b/addr2line.c @@ -1585,6 +1585,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; @@ -1605,6 +1606,7 @@ uncompress_debug_section(ElfW(Shdr) *shdr, char *file, char **ptr) fail: free(*ptr); + *ptr = NULL; #endif return 0; } |