From owner-freebsd-bugs Mon Apr 16 12: 0: 6 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 C03A737B440 for ; Mon, 16 Apr 2001 12:00:02 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id f3GJ02Z44838; Mon, 16 Apr 2001 12:00:02 -0700 (PDT) (envelope-from gnats) Received: from horsey.gshapiro.net (horsey.gshapiro.net [209.220.147.178]) by hub.freebsd.org (Postfix) with ESMTP id 60F7037B43E for ; Mon, 16 Apr 2001 11:57:12 -0700 (PDT) (envelope-from gshapiro@gshapiro.net) Received: (from gshapiro@localhost) by horsey.gshapiro.net (8.12.0.Beta7/8.12.0.Beta7) id f3GIvBDF035576; Mon, 16 Apr 2001 11:57:11 -0700 (PDT) Message-Id: <200104161857.f3GIvBDF035576@horsey.gshapiro.net> Date: Mon, 16 Apr 2001 11:57:11 -0700 (PDT) From: gshapiro+FreeBSD-gnats@gshapiro.net Reply-To: gshapiro+FreeBSD-gnats@gshapiro.net To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.113 Subject: bin/26619: m4 silently truncates long strings Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 26619 >Category: bin >Synopsis: m4 silently truncates long lines >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Apr 16 12:00:02 PDT 2001 >Closed-Date: >Last-Modified: >Originator: Gregory Neil Shapiro >Release: FreeBSD 4.3-RC i386 >Organization: >Environment: System: FreeBSD horsey.gshapiro.net 4.3-RC FreeBSD 4.3-RC #15: Sat Apr 14 12:21:56 PDT 2001 gshapiro@horsey.gshapiro.net:/home/FreeBSD/RELENG_4/obj/sys/HORSEY i386 >Description: m4 will silently truncate long strings on some operations leaving the data corrupted. >How-To-Repeat: The m4 file below demonstrates the problem. Note that after running it with: m4 test.m4 The output shows SameList has been truncated without an error from m4. Here is test.m4: define(`LongList', ` assert.c debug.c exc.c heap.c match.c rpool.c strdup.c strerror.c strl.c clrerr.c fclose.c feof.c ferror.c fflush.c fget.c fpos.c findfp.c flags.c fopen.c fprintf.c fpurge.c fput.c fread.c fscanf.c fseek.c fvwrite.c fwalk.c fwrite.c get.c makebuf.c put.c refill.c rewind.c rget.c setvbuf.c smstdio.c snprintf.c sscanf.c stdio.c strio.c syslogio.c ungetc.c vasprintf.c vfprintf.c vfscanf.c vprintf.c vsnprintf.c vsprintf.c vsscanf.c wbuf.c wsetup.c stringf.c xtrap.c strto.c test.c path.c strcasecmp.c signal.c clock.c config.c shm.c ')dnl define(`SameList', `substr(LongList, 0, index(LongList, `.'))`'substr(LongList, index(LongList, `.'))')dnl Long`'List is: LongList Same`'List is: SameList ifelse(len(LongList), len(SameList), `', `errprint(`This version of m4 is broken: length problem')')dnl >Fix: >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message