public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Sanity check dwarf5 form of .file
@ 2023-01-26 21:52 Alan Modra
  0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2023-01-26 21:52 UTC (permalink / raw)
  To: binutils

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.

diff --git a/gas/dwarf2dbg.c b/gas/dwarf2dbg.c
index 86dc16108e4..5f2f58ff7b0 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 ();
 	}
 

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-01-26 21:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-26 21:52 Sanity check dwarf5 form of .file Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).