Sanity check dwarf5 form of .file
authorAlan Modra <amodra@gmail.com>
Thu, 26 Jan 2023 08:29:07 +0000 (18:59 +1030)
committerAlan Modra <amodra@gmail.com>
Thu, 26 Jan 2023 21:48:46 +0000 (08:18 +1030)
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.

gas/dwarf2dbg.c

index 86dc16108e4a4a39c7c5069f71993aa3767294b2..5f2f58ff7b05c4556943d2993af60defaf1bb7fd 100644 (file)
@@ -1195,6 +1195,8 @@ dwarf2_directive_filename (void)
        {
          dirname = filename;
          filename = demand_copy_C_string (&filename_len);
+         if (filename == NULL)
+           return NULL;
          SKIP_WHITESPACE ();
        }