From e50fe447d7dc73b902eee55bbcd78f63c8a7a070 Mon Sep 17 00:00:00 2001 From: augustss Date: Wed, 12 Nov 1997 02:02:34 +0000 Subject: Make sure numeric escapes are limited to 3 characters. --- gnu/usr.bin/gas/read.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'gnu') diff --git a/gnu/usr.bin/gas/read.c b/gnu/usr.bin/gas/read.c index 62dae35786b..6b7bd8620c2 100644 --- a/gnu/usr.bin/gas/read.c +++ b/gnu/usr.bin/gas/read.c @@ -19,7 +19,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef lint -static char rcsid[] = "$Id: read.c,v 1.17 1996/12/21 21:48:20 pk Exp $"; +static char rcsid[] = "$Id: read.c,v 1.18 1997/11/12 02:02:34 augustss Exp $"; #endif #define MASK_CHAR (0xFF) /* If your chars aren't 8 bits, you will @@ -2095,8 +2095,11 @@ unsigned int next_char_of_string() { case '8': case '9': { long number; + int nchar; - for (number = 0; isdigit(c); c = *input_line_pointer++) { + for (nchar = 0, number = 0; + nchar < 3 && isdigit(c); + c = *input_line_pointer++, nchar++) { number = number * 8 + c - '0'; } c = number & 0xff; -- cgit