gdb: bfd_get_symbol_leading_char vs. ""
authorAlan Modra <amodra@gmail.com>
Tue, 22 Aug 2023 11:50:57 +0000 (21:20 +0930)
committerAlan Modra <amodra@gmail.com>
Wed, 23 Aug 2023 00:37:45 +0000 (10:07 +0930)
commit0e3513d256c3b4475aa7fae33d20e073c3a3b929
tree0bc89a155b4fd5546fac05bd029c943c464dbd26
parent8c8145a43ee4815b8851f8da7091c04f551dff6e
gdb: bfd_get_symbol_leading_char vs. ""

Some places matching the first char of a string against
bfd_get_symbol_leading_char, which may be zero, didn't check for "".
This could lead to accesses past the end of the string and potential
buffer overruns.  Fix that, and also get rid of a stupid optimisation
in dbxread when looking for "__DYNAMIC" that also might access past
the end of a string.
gdb/coffread.c
gdb/dbxread.c
gdb/machoread.c