summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/gas
diff options
context:
space:
mode:
authoraugustss <augustss@NetBSD.org>1997-11-12 02:02:34 +0000
committeraugustss <augustss@NetBSD.org>1997-11-12 02:02:34 +0000
commite50fe447d7dc73b902eee55bbcd78f63c8a7a070 (patch)
treea9ed7ba0916170ab880996242dfe57041b7f0924 /gnu/usr.bin/gas
parentc144b2c93b77fce9bae27dabd98ec45d54f4c710 (diff)
Make sure numeric escapes are limited to 3 characters.
Diffstat (limited to 'gnu/usr.bin/gas')
-rw-r--r--gnu/usr.bin/gas/read.c7
1 files changed, 5 insertions, 2 deletions
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;