]> git.ipfire.org Git - thirdparty/gcc.git/commit
[libbacktrace] Fix strrchr segfault
authorvries <vries@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 25 Jan 2019 14:39:58 +0000 (14:39 +0000)
committervries <vries@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 25 Jan 2019 14:39:58 +0000 (14:39 +0000)
commit2ed0e16fcfc7768079121b61ee66f80cd7386732
tree4a320ed1ce1aa49329041a5d06027e300d24ee86
parenta76703bb02f71a617ff05204f313c566dc9b0636
[libbacktrace] Fix strrchr segfault

Currently, when running a libbacktrace testcase t with .gnu_debuglink to
t.debug, and t.debug having a .gnu_debugaltlink to t.alt.debug, a segfault
is triggered when calling strrchr with a NULL string from
elf_find_debugfile_by_debuglink.  The NULL string originates from the elf_add
called for the .gnu_debugaltlink, which uses NULL as filename argument.

Fix this by using "" as filename argument instead.

2019-01-25  Tom de Vries  <tdevries@suse.de>

* elf.c (elf_add): When handling .gnu_debugaltlink, call elf_add with
filename == "".
* Makefile.am (TESTS): Add btest_dwz_gnudebuglink.
* Makefile.in: Regenerate.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@268269 138bc75d-0d04-0410-961f-82ee72b054a4
libbacktrace/ChangeLog
libbacktrace/Makefile.am
libbacktrace/Makefile.in
libbacktrace/elf.c