From owner-freebsd-bugs Mon Sep 22 14:40:03 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id OAA22870 for bugs-outgoing; Mon, 22 Sep 1997 14:40:03 -0700 (PDT) Received: (from gnats@localhost) by hub.freebsd.org (8.8.7/8.8.7) id OAA22848; Mon, 22 Sep 1997 14:40:01 -0700 (PDT) Resent-Date: Mon, 22 Sep 1997 14:40:01 -0700 (PDT) Resent-Message-Id: <199709222140.OAA22848@hub.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@FreeBSD.ORG, roberte@MEP.Ruhr-Uni-Bochum.de Received: from ghost.mep.ruhr-uni-bochum.de (ghost.mep.ruhr-uni-bochum.de [134.147.6.33]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id OAA22207 for ; Mon, 22 Sep 1997 14:32:50 -0700 (PDT) Received: (from roberte@localhost) by ghost.mep.ruhr-uni-bochum.de (8.8.5/8.8.4) id XAA01547; Mon, 22 Sep 1997 23:32:50 +0200 (MESZ) Message-Id: <199709222132.XAA01547@ghost.mep.ruhr-uni-bochum.de> Date: Mon, 22 Sep 1997 23:32:50 +0200 (MESZ) From: Robert Eckardt Reply-To: roberte@MEP.Ruhr-Uni-Bochum.de To: FreeBSD-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: 3.2 Subject: bin/4607: fmt dumps core on ^M (in 2.2.2 again) Sender: owner-freebsd-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >Number: 4607 >Category: bin >Synopsis: fmt dumps core on ^M (in 2.2.2 again) >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Sep 22 14:40:01 PDT 1997 >Last-Modified: >Originator: Robert Eckardt >Organization: >Release: FreeBSD 2.2.2-RELEASE i386 >Environment: FreeBSD-2.2.2 with tcsh under X >Description: fmt experiences Bus error when one tries to format a text that starts with ^M (CR) (e.g. from an MSDOS system) or another non-printable character. This bug was already handled and removed for FreeBSD 2.2-BETA_A under `bin/2968'. >How-To-Repeat: In the simplest case: 1:05 ghost: /home/re 0% printf '\r'>fmttest 1:05 ghost: /home/re 0% fmt fmttest Bus error (core dumped) >Fix: Gareth McCaughan (gjm11@dpmms.cam.ac.uk) supplied the following patch for 2.2-BETA_A, which also works for 2.2.2: *** fmt.c.orig Mon Sep 22 23:28:42 1997 --- fmt.c Mon Sep 22 23:25:01 1997 *************** *** 147,151 **** register int c, col; #define CHUNKSIZE 1024 ! static int lbufsize = 0, cbufsize = 0; if (center) { --- 147,155 ---- register int c, col; #define CHUNKSIZE 1024 ! static int lbufsize = 0, cbufsize = CHUNKSIZE; ! ! canonb = malloc(CHUNKSIZE); ! if (canonb == 0) ! abort(); if (center) { >Audit-Trail: >Unformatted: