Correctly calculate a buffer length. It was off by one so a read() returned

one byte less than needed.

This is a RELENG_x_y candidate, since it fixes a problem with Oracle 10.

Noticed by:	Dmitry Ganenko <dima@apk-inform.com>
Testcase by:	Dmitry Ganenko <dima@apk-inform.com>
Reviewed by:	des
Submitted by:	rdivacky
Sponsored by:	Google SoC 2006
MFC after:	1 week
This commit is contained in:
Alexander Leidinger 2006-06-27 20:21:38 +00:00
parent 550be19e16
commit 85646f7eb1
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=159996

View File

@ -515,7 +515,7 @@ pfs_read(struct vop_read_args *va)
if (uio->uio_offset < 0 || uio->uio_resid < 0 ||
(offset = uio->uio_offset) != uio->uio_offset ||
(resid = uio->uio_resid) != uio->uio_resid ||
(buflen = offset + resid) < offset || buflen > INT_MAX) {
(buflen = offset + resid + 1) < offset || buflen > INT_MAX) {
if (proc != NULL)
PRELE(proc);
PFS_RETURN (EINVAL);