Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Sep 1997 23:32:50 +0200 (MESZ)
From:      Robert Eckardt <roberte@MEP.Ruhr-Uni-Bochum.de>
To:        FreeBSD-gnats-submit@FreeBSD.ORG
Subject:   bin/4607: fmt dumps core on ^M (in 2.2.2 again)
Message-ID:  <199709222132.XAA01547@ghost.mep.ruhr-uni-bochum.de>
Resent-Message-ID: <199709222140.OAA22848@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199709222132.XAA01547>