From ff357987c613e6d18617f8d2947026ca548513ff Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Sun, 13 Jun 2004 17:11:18 +0000 Subject: 1-byte overflow; ryo@nerv.org, otto ok --- usr.bin/sed/compile.c | 6 +++--- 1 file 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 @@ -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++) -- cgit v1.2.3