From xaa@xaa.iae.nl  Wed Jan  6 11:35:39 1999
Received: from esmeralda.xaa.iae.nl (esmeralda.xaa.iae.nl [194.151.75.9])
          by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id LAA25727
          for <FreeBSD-gnats-submit@freebsd.org>; Wed, 6 Jan 1999 11:35:36 -0800 (PST)
          (envelope-from xaa@xaa.iae.nl)
Received: by esmeralda.xaa.iae.nl (Postfix, from userid 1002)
	id AE5341DC; Wed,  6 Jan 1999 20:35:05 +0100 (MET)
Message-Id: <19990106193505.AE5341DC@esmeralda.xaa.iae.nl>
Date: Wed,  6 Jan 1999 20:35:05 +0100 (MET)
From: xaa@xaa.iae.nl
Reply-To: xaa@xaa.iae.nl
To: FreeBSD-gnats-submit@freebsd.org
Subject: nvi has error in reading files with very long lines
X-Send-Pr-Version: 3.2

>Number:         9350
>Category:       bin
>Synopsis:       nvi incorrectly reads files with very long lines
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    obrien
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jan  6 11:40:00 PST 1999
>Closed-Date:    Thu May 25 08:20:44 PDT 2000
>Last-Modified:  Thu May 25 08:21:00 PDT 2000
>Originator:     Mark Huizer
>Release:        FreeBSD 3.0-CURRENT i386
>Organization:
>Environment:

	noticed in 2.2.7 and 3.0-current

>Description:

	When opening a file with a very long line in it (when I tried it
	I had a line with over 80000 characters), the line is truncated,
	that is: the first part is missing (in my case 80% was missing)

>How-To-Repeat:

	Create file with VERY long line in it (jot is your friend :-),
	save it, check with more or less that it is correct, open with
	vi.

>Fix:
	
	I found it while looking for a bug in another program, so, not
	yet, sorry :-(

>Release-Note:
>Audit-Trail:

From: "Danny J. Zerkel" <dzerkel@columbus.rr.com>
To: freebsd-gnats-submit@freebsd.org, xaa@xaa.iae.nl
Cc:  
Subject: Re: bin/9350: nvi incorrectly reads files with very long lines
Date: Sun, 01 Aug 1999 00:41:32 -0400

 Mark,
 
 Here's my fix.  Turns out to be a bug in the db library.  When the read
 buffer has to be expanded beyond 65535, the current character pointer
 gets warped back to the beginning of the buffer, since the size indx_t
 is only 16 bits.
 
 I wonder what else this fixes?  :-)
 
 --- /usr/src/lib/libc/db/recno/rec_get.c.orig   Wed Sep 16 00:17:42 1998
 +++ /usr/src/lib/libc/db/recno/rec_get.c        Sun Aug  1 00:34:16 1999
 @@ -181,7 +181,7 @@
  {
         DBT data;
         recno_t nrec;
 -       indx_t len;
 +       size_t len;
         size_t sz;
         int bval, ch;
         u_char *p;
 
 -- Danny J. Zerkel
 dzerkel@columbus.rr.com
 
Responsible-Changed-From-To: freebsd-bugs->obrien 
Responsible-Changed-By: obrien 
Responsible-Changed-When: Tue May 2 20:33:29 PDT 2000 
Responsible-Changed-Why:  

State-Changed-From-To: open->closed 
State-Changed-By: obrien 
State-Changed-When: Thu May 25 08:20:44 PDT 2000 
State-Changed-Why:  
commited 

thanks! 
>Unformatted:
