summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2004-06-13 17:11:18 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2004-06-13 17:11:18 +0000
commitff357987c613e6d18617f8d2947026ca548513ff (patch)
tree913d47a1f0d8d38101fb88bc33e87fc1e2276da0
parentc4a204dd5b8707f31f915ef5ee4b5063e7c8ff96 (diff)
1-byte overflow; ryo@nerv.org, otto ok
-rw-r--r--usr.bin/sed/compile.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/sed/compile.c b/usr.bin/sed/compile.c
index 4dacec407c3..7e334585906 100644
--- a/usr.bin/sed/compile.c
+++ b/usr.bin/sed/compile.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: compile.c,v 1.17 2004/02/17 16:13:33 otto Exp $ */
+/* $OpenBSD: compile.c,v 1.18 2004/06/13 17:11:17 deraadt Exp $ */
/*-
* Copyright (c) 1992 Diomidis Spinellis.
@@ -35,7 +35,7 @@
#ifndef lint
/* from: static char sccsid[] = "@(#)compile.c 8.2 (Berkeley) 4/28/95"; */
-static char *rcsid = "$OpenBSD: compile.c,v 1.17 2004/02/17 16:13:33 otto Exp $";
+static char *rcsid = "$OpenBSD: compile.c,v 1.18 2004/06/13 17:11:17 deraadt Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -596,7 +596,7 @@ compile_tr(char *p, char **transtab)
return (NULL);
}
/* We assume characters are 8 bits */
- lt = xmalloc(UCHAR_MAX);
+ lt = xmalloc(UCHAR_MAX + 1);
for (i = 0; i <= UCHAR_MAX; i++)
lt[i] = (char)i;
for (op = old, np = new; *op; op++, np++)