aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2023-01-26 18:59:07 +1030
committerAlan Modra <amodra@gmail.com>2023-01-27 08:18:46 +1030
commitdd61b2d1ac00632bf2f42cdbbb32486f021e469e (patch)
treeb3c7d9b16009336b3f0a1183903cb57922f81cae /gas
parent44a178cc69a05d03bcde37a4f46e4e8e81287b84 (diff)
downloadgdb-dd61b2d1ac00632bf2f42cdbbb32486f021e469e.zip
gdb-dd61b2d1ac00632bf2f42cdbbb32486f021e469e.tar.gz
gdb-dd61b2d1ac00632bf2f42cdbbb32486f021e469e.tar.bz2
Sanity check dwarf5 form of .file
There's a comment a few lines earlier saying that demand_copy_C_string has already reported an error if it returns NULL. Given the proximity I decided not to duplicate the comment. * dwarf2dbg.c (dwarf2_directive_filename): Check return of demand_copy_C_string for file.
Diffstat (limited to 'gas')
-rw-r--r--gas/dwarf2dbg.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gas/dwarf2dbg.c b/gas/dwarf2dbg.c
index 86dc161..5f2f58f 100644
--- a/gas/dwarf2dbg.c
+++ b/gas/dwarf2dbg.c
@@ -1195,6 +1195,8 @@ dwarf2_directive_filename (void)
{
dirname = filename;
filename = demand_copy_C_string (&filename_len);
+ if (filename == NULL)
+ return NULL;
SKIP_WHITESPACE ();
}