ubsan: next_char_of_string signed integer overflow

Alan Modra amodra@gmail.com
Sat Jan 1 05:19:47 GMT 2022


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


More information about the Binutils mailing list