From owner-freebsd-bugs Wed May 9 9:30: 7 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 2444537B422 for ; Wed, 9 May 2001 09:30:03 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id f49GU3s07584; Wed, 9 May 2001 09:30:03 -0700 (PDT) (envelope-from gnats) Date: Wed, 9 May 2001 09:30:03 -0700 (PDT) Message-Id: <200105091630.f49GU3s07584@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Gregory Neil Shapiro Subject: Re: bin/26619: m4 silently truncates long strings Reply-To: Gregory Neil Shapiro Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org The following reply was made to PR bin/26619; it has been noted by GNATS. From: Gregory Neil Shapiro To: Kris Kennaway Cc: gshapiro+FreeBSD-gnats@gshapiro.net, FreeBSD-gnats-submit@FreeBSD.ORG Subject: Re: bin/26619: m4 silently truncates long strings Date: Wed, 9 May 2001 09:20:10 -0700 >> >Description: >> m4 will silently truncate long strings on some operations leaving the data >> corrupted. kris> Any luck at identifying where the problem lies, or a fix? I have a fix but since I am not an expert on the m4 internals (damn, should have taken compilers in college), I didn't want to blindly commit it. This fixes the problem (to be honest, it's changes the problem from 512 characters to 4096 characters). However, I don't know if it introduces any side effects. It may be possible that some of the code was depending on MAXSTR being 512 and changing it introduces a buffer overflow. Index: mdef.h =================================================================== RCS file: /src/FreeBSD/cvsrepo/src/usr.bin/m4/mdef.h,v retrieving revision 1.3 diff -u -r1.3 mdef.h --- mdef.h 1995/05/30 06:31:35 1.3 +++ mdef.h 2001/05/09 16:17:55 @@ -96,7 +96,7 @@ #define EOS (char) 0 #define MAXINP 10 /* maximum include files */ #define MAXOUT 10 /* maximum # of diversions */ -#define MAXSTR 512 /* maximum size of string */ +#define MAXSTR 4096 /* maximum size of string */ #define BUFSIZE 4096 /* size of pushback buffer */ #define STACKMAX 1024 /* size of call stack */ #define STRSPMAX 4096 /* size of string space */ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message