diff options
author | Nick Alcock <nick.alcock@oracle.com> | 2020-11-20 13:34:04 +0000 |
---|---|---|
committer | Nick Alcock <nick.alcock@oracle.com> | 2020-11-20 13:34:13 +0000 |
commit | ef21dd3bcffd350f0bf27386f1eafe8095d8feec (patch) | |
tree | 8c3b7fb17d3ac94f9d1bfc6df3ccfa440d39c606 /libctf/ChangeLog | |
parent | 8f235c90a287ee961153dd94f5ca28b033ebb668 (diff) | |
download | gdb-ef21dd3bcffd350f0bf27386f1eafe8095d8feec.zip gdb-ef21dd3bcffd350f0bf27386f1eafe8095d8feec.tar.gz gdb-ef21dd3bcffd350f0bf27386f1eafe8095d8feec.tar.bz2 |
libctf: do not crash when CTF symbol or variable linking fails
When linking fails, we delete all the generated outputs, but we fail to
remove them from the ctf_link_outputs hash we stuck them in before doing
symbol and variable section linking (which we had to do because that's
where ctf_create_per_cu, used by both, looks for them). This leaves
stale pointers to freed memory behind, and crashes soon follow.
Fix obvious.
libctf/ChangeLog
2020-11-20 Nick Alcock <nick.alcock@oracle.com>
* ctf-link.c (ctf_link_deduplicating): Clean up the ctf_link_outputs
hash on error.
Diffstat (limited to 'libctf/ChangeLog')
-rw-r--r-- | libctf/ChangeLog | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libctf/ChangeLog b/libctf/ChangeLog index 0a8da12..7fdb355 100644 --- a/libctf/ChangeLog +++ b/libctf/ChangeLog @@ -1,5 +1,10 @@ 2020-11-20 Nick Alcock <nick.alcock@oracle.com> + * ctf-link.c (ctf_link_deduplicating): Clean up the ctf_link_outputs + hash on error. + +2020-11-20 Nick Alcock <nick.alcock@oracle.com> + * ctf-create.c (ctf_dtd_insert): Set ENOMEM on the dict if out of memory. (ctf_dvd_insert): Likewise. (ctf_add_function): Report ECTF_RDONLY if this dict is not writable. |