]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Fix possibly unitialized variables in __cxa_demangle_gnu3()
authorDimitry Andric <dim@FreeBSD.org>
Mon, 22 Feb 2021 20:01:09 +0000 (21:01 +0100)
committerDimitry Andric <dim@FreeBSD.org>
Wed, 24 Feb 2021 19:39:57 +0000 (20:39 +0100)
commit64809c763b0c73fe488b61601670067056b07780
tree6afa2146ca0f70fc60461f04540d4e1ebe2520d4
parent5e57a3806ef3dc9d04981b1bc06f69507cc67684
Fix possibly unitialized variables in __cxa_demangle_gnu3()

After 0ee0dbfb0d26cf4bc37f24f12e76c7f532b0f368 where I imported a more
recent libcxxrt snapshot, the variables 'rtn' and 'has_ret' could in
some cases be used while still uninitialized. Most obviously this would
lead to a jemalloc complaint about a bad free(), aborting the program.

Fix this by initializing a bunch variables in their declarations. This
change has also been sent upstream, with some additional changes to be
used in their testing framework.

PR: 253226

(cherry picked from commit d149877758f162f0c777e7760164bf2c1f7a1bc1)
contrib/libcxxrt/libelftc_dem_gnu3.c