Subject: bin/25911: sed/compile.c is writing outside of allocated memory
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <ryo@nerv.org>
List: netbsd-bugs
Date: 06/12/2004 19:17:36
>Number: 25911
>Category: bin
>Synopsis: sed/compile.c is writing outside of allocated memory
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: bin-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sat Jun 12 19:18:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator: SHIMIZU Ryo
>Release: NetBSD 1.6ZG
>Organization:
>Environment:
NetBSD moveq.nerv.org 1.6ZG NetBSD 1.6ZG (MOVEQ) #0: Sun Dec 21 02:07:24 JST 2003 ryo@moveq.nerv.org:/usr/src/sys/arch/i386/compile/MOVEQ i386
>Description:
sed/compile.c is writing outside of allocated memory.
please refer following patch.
>How-To-Repeat:
>Fix:
--- compile.c 7 Aug 2003 11:15:49 -0000 1.25
+++ compile.c 12 Jun 2004 18:57:02 -0000
@@ -634,7 +634,7 @@
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++)
>Release-Note:
>Audit-Trail:
>Unformatted: