public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* ubsan: next_char_of_string signed integer overflow
@ 2022-01-01  5:19 Alan Modra
  0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2022-01-01  5:19 UTC (permalink / raw)
  To: binutils

Squash another totally useless fuzz report.

	* read.c (next_char_of_string): Avoid integer overflow.

diff --git a/gas/read.c b/gas/read.c
index cd82c83adeb..6c8b7c3efdb 100644
--- a/gas/read.c
+++ b/gas/read.c
@@ -5642,7 +5642,7 @@ next_char_of_string (void)
 	case '8':
 	case '9':
 	  {
-	    long number;
+	    unsigned number;
 	    int i;
 
 	    for (i = 0, number = 0;
@@ -5660,7 +5660,7 @@ next_char_of_string (void)
 	case 'x':
 	case 'X':
 	  {
-	    long number;
+	    unsigned number;
 
 	    number = 0;
 	    c = *input_line_pointer++;

-- 
Alan Modra
Australia Development Lab, IBM

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

only message in thread, other threads:[~2022-01-01  5:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-01  5:19 ubsan: next_char_of_string signed integer overflow 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).