Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 7 Aug 1999 20:10:02 -0700 (PDT)
From:      "Danny J. Zerkel" <dzerkel@columbus.rr.com>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: bin/12242: segmentation fault running /usr/bin/fmt
Message-ID:  <199908080310.UAA28383@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/12242; it has been noted by GNATS.

From: "Danny J. Zerkel" <dzerkel@columbus.rr.com>
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




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