Avoid use-after-free in DWARF debug names code
authorTom Tromey <tromey@adacore.com>
Mon, 1 Jul 2019 15:33:19 +0000 (09:33 -0600)
committerTom Tromey <tromey@adacore.com>
Mon, 1 Jul 2019 15:36:30 +0000 (09:36 -0600)
commit54ee425275c759438d90c40781e3810a551f0a5f
tree5cdc2e373b514b596fe39800d09fb41a7f6198ac
parent269b4ded72af1fa05236f866b518f05cf2d408a6
Avoid use-after-free in DWARF debug names code

A static analyzer pointed out that find_vec_in_debug_names will use
the contents of a unique_ptr after it has been destroyed.  This patch
fixes the bug by hoisting the declaration into the appropriate
enclosing block.

I'm checking this in as obvious.

gdb/ChangeLog
2019-07-01  Tom Tromey  <tromey@adacore.com>

* dwarf2read.c
(dw2_debug_names_iterator::find_vec_in_debug_names): Hoist
declaration of without_params.  Fix formatting.
gdb/ChangeLog
gdb/dwarf2read.c