ubsan: next_char_of_string signed integer overflow

Message ID Yc/kcyO95U4Fv5fq@squeak.grove.modra.org
State New
Headers show
Series
  • ubsan: next_char_of_string signed integer overflow
Related show

Commit Message

H.J. Lu via Binutils Jan. 1, 2022, 5:19 a.m.
Squash another totally useless fuzz report.

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


-- 
Alan Modra
Australia Development Lab, IBM

Patch

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++;