public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Recursion in as_info_where
@ 2023-02-01  6:36 Alan Modra
  2023-02-01  9:24 ` Jan Beulich
  0 siblings, 1 reply; 5+ messages in thread
From: Alan Modra @ 2023-02-01  6:36 UTC (permalink / raw)
  To: binutils

[-- Attachment #1: Type: text/plain, Size: 706 bytes --]

This function has a gas_assert, ie. possible call to as_abort, which
calls as_report_context, which calls as_info_where.  Attached fuzzer
testcase managed to trigger a stack overflow.

	* messages.c (as_info_where): Don't gas_assert.

diff --git a/gas/messages.c b/gas/messages.c
index 0db075d779c..7c018acf69f 100644
--- a/gas/messages.c
+++ b/gas/messages.c
@@ -141,8 +141,6 @@ as_info_where (const char *file, unsigned int line, unsigned int indent,
   va_list args;
   char buffer[2000];
 
-  gas_assert (file != NULL && line > 0 && indent <= INT_MAX);
-
   va_start (args, format);
   vsnprintf (buffer, sizeof (buffer), format, args);
   va_end (args);

-- 
Alan Modra
Australia Development Lab, IBM

[-- Attachment #2: clusterfuzz-testcase-minimized-fuzz_as-5392730034667520 --]
[-- Type: application/octet-stream, Size: 26 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-02-06  1:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-01  6:36 Recursion in as_info_where Alan Modra
2023-02-01  9:24 ` Jan Beulich
2023-02-01 11:59   ` Alan Modra
2023-02-03 13:44     ` Jan Beulich
2023-02-06  1:41       ` 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).