Subject: CVS commit: basesrc
To: None <source-changes@netbsd.org>
From: Jaromir Dolecek <jdolecek@netbsd.org>
List: source-changes
Date: 05/15/2001 14:49:26
Module Name:	basesrc
Committed By:	jdolecek
Date:		Tue May 15 11:49:26 UTC 2001

Modified Files:
	basesrc/usr.bin/sort: fsort.c

Log Message:
Only try to copy the extra incomplete record data if there is anything
actually read already. Albeit it's not damaging to copy zero data
for bufend == crec->data case, the buffer end could also be between
memory position 'crec' and 'crec->data'. Thus, we could end up with
negative 'bufend - crec->data' value, and obvious havoc.

This change fixes lib/12673, though the problem was masked and no longer
repeatable with the provided example after the recent buffer size bump.
The change was tested with the buffer size change backed off, and really
fixes the problem in the PR.


To generate a diff of this commit:
cvs rdiff -r1.19 -r1.20 basesrc/usr.bin/sort/fsort.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.