summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2004-12-06 20:17:05 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2004-12-06 20:17:05 +0000
commit5d0317026f85e8f4e0fc972d66b254fe4ca1f9fc (patch)
treed7e69cf36191342cb367dd4e26b05d7348f8ef19 /gnu
parent120d8ac9c11b65f4f5ea455c3ece1377f7c9f5e9 (diff)
Do not access memory out of bounds when parsing input; fixes an incorrect
as behaviour when compiling sys/arch/mac68k/dev/if_ae.c with -pipe. ok tdeval@ deraadt@
Diffstat (limited to 'gnu')
-rw-r--r--gnu/usr.bin/gas/read.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/gnu/usr.bin/gas/read.c b/gnu/usr.bin/gas/read.c
index c457288d885..d76fb6db1ba 100644
--- a/gnu/usr.bin/gas/read.c
+++ b/gnu/usr.bin/gas/read.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: read.c,v 1.11 2004/08/05 19:12:32 miod Exp $ */
+/* $OpenBSD: read.c,v 1.12 2004/12/06 20:17:04 miod Exp $ */
/* read.c - read a source file -
@@ -21,7 +21,7 @@
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#ifndef lint
-static char rcsid[] = "$OpenBSD: read.c,v 1.11 2004/08/05 19:12:32 miod Exp $";
+static char rcsid[] = "$OpenBSD: read.c,v 1.12 2004/12/06 20:17:04 miod Exp $";
#endif
#define MASK_CHAR (0xFF) /* If your chars aren't 8 bits, you will
@@ -425,7 +425,9 @@ char *name;
SKIP_WHITESPACE();
- } else if (c == '=' || input_line_pointer[1] == '=') { /* JF deal with FOO=BAR */
+ } else if (c == '=' ||
+ ((input_line_pointer + 1) < buffer_limit &&
+ input_line_pointer[1] == '=')) { /* JF deal with FOO=BAR */
equals(s);
demand_empty_rest_of_line();
} else { /* expect pseudo-op or machine instruction */