r266562 - in /trunk/libbacktrace: ChangeLog dwa...

vries@gcc.gnu.org vries@gcc.gnu.org
Wed Nov 28 14:06:00 GMT 2018


Author: vries
Date: Wed Nov 28 14:06:23 2018
New Revision: 266562

URL: https://gcc.gnu.org/viewcvs?rev=266562&root=gcc&view=rev
Log:
[libbacktrace] Fix segfault upon allocation failure

If the allocation of abbrevs->abbrevs in read_abbrevs fails, then
abbrevs->num_abbrevs remains nonzero, and consequently free_abbrevs will
segfault when accessing abbrevs->abbrevs.

Fix this by setting abbrevs->num_abbrevs only after abbrevs->abbrevs
allocation has succeeded.

Bootstrapped and reg-tested on x86_64.

2018-11-28  Tom de Vries  <tdevries@suse.de>

	* dwarf.c (read_abbrevs): Fix handling of abbrevs->abbrevs allocation
	failure.

Modified:
    trunk/libbacktrace/ChangeLog
    trunk/libbacktrace/dwarf.c



More information about the Gcc-cvs mailing list