]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - bfd/xcofflink.c
heap use after free in xcoff_archive_info_eq
authorAlan Modra <amodra@gmail.com>
Thu, 3 Sep 2020 00:04:37 +0000 (09:34 +0930)
committerAlan Modra <amodra@gmail.com>
Thu, 3 Sep 2020 01:34:46 +0000 (11:04 +0930)
commitd48b742bc1a7af6a673e747c91bf7c72518a0b6a
tree60f4a40277a0d7e54689ab6b25967c31c997d1d2
parent8807b2206d245d37d81030c693fbdf39f6789e7a
heap use after free in xcoff_archive_info_eq

Using an input file objalloc memory for anything that isn't created
when opening the bfd is not a good idea.  The problem is that this
memory can disappear if bfd_free_cached_info is called or when bfd
closes files in order to keep the number of open files reasonable.

bfd/
* xcofflink.c (xcoff_get_archive_info): Allocate xcoff_archive_info
on the output bfd objalloc memory.
ld/
* testsuite/ld-scripts/sysroot-prefix.exp (single_sysroot_prefix_test):
Log $scriptname.
bfd/ChangeLog
bfd/xcofflink.c
ld/ChangeLog
ld/testsuite/ld-scripts/sysroot-prefix.exp