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:
parent
550be19e16
commit
85646f7eb1
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user