From owner-freebsd-bugs Sat Aug 7 20:12:33 1999 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id C861214CE1 for ; Sat, 7 Aug 1999 20:12:31 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id UAA28383; Sat, 7 Aug 1999 20:10:02 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Date: Sat, 7 Aug 1999 20:10:02 -0700 (PDT) Message-Id: <199908080310.UAA28383@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: "Danny J. Zerkel" Subject: Re: bin/12242: segmentation fault running /usr/bin/fmt Reply-To: "Danny J. Zerkel" Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org The following reply was made to PR bin/12242; it has been noted by GNATS. From: "Danny J. Zerkel" To: freebsd-gnats-submit@freebsd.org, grg@isabase.philol.msu.ru Cc: Subject: Re: bin/12242: segmentation fault running /usr/bin/fmt Date: Sat, 07 Aug 1999 23:05:51 -0400 Grigoriy, Doing math on null pointers, sounds bad to me... This only was a problem if the first line was longer than the default buffer size of 1024. Of course, fmt does nothing to this file since it is only one line and starts with '.'. This patch will at least keep it from dumping core. --- /usr/src/usr.bin/fmt/fmt.c.orig Tue Sep 30 15:42:05 1997 +++ /usr/src/usr.bin/fmt/fmt.c Sat Aug 7 22:40:31 1999 @@ -450,7 +450,8 @@ outbuf = realloc(outbuf, outbuf_size); if (outbuf == 0) abort(); - outp += outbuf-old_outbuf; + if (outp != NOSTR) + outp += outbuf-old_outbuf; } if (outp == NOSTR) -- Danny J. Zerkel dzerkel@columbus.rr.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message