]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
PR30828, notes obstack memory corruption
authorAlan Modra <amodra@gmail.com>
Wed, 6 Sep 2023 23:13:53 +0000 (08:43 +0930)
committerAlan Modra <amodra@gmail.com>
Wed, 6 Sep 2023 23:23:25 +0000 (08:53 +0930)
commit9e99d10c9a7fc20adb0009d3761fe3cdfdbe0a8c
treebbce1c18711e2ffc0945f1adef26cc6fdd4141b7
parent313b2841b8e9046ea658104988e01bedf6148d5f
PR30828, notes obstack memory corruption

Commit 3bab069c29b3 carelessly allowed "string" to be released from
the notes obstack twice, with the second call to obstack_free
releasing memory for a fixup that just happened to be the same size as
the original string.  The fixup then of course was overwritten.
This patch fixes that problem, and another that could occur on an
error path.

PR 30828
* stabs.c (s_stab_generic): Don't free string twice.  Don't
blow away entire notes obstack on a missing string.
gas/stabs.c