From 85646f7eb19bb43aca9284b4bb31d30a7fad0b32 Mon Sep 17 00:00:00 2001 From: Alexander Leidinger Date: Tue, 27 Jun 2006 20:21:38 +0000 Subject: [PATCH] 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 Testcase by: Dmitry Ganenko Reviewed by: des Submitted by: rdivacky Sponsored by: Google SoC 2006 MFC after: 1 week --- sys/fs/pseudofs/pseudofs_vnops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/fs/pseudofs/pseudofs_vnops.c b/sys/fs/pseudofs/pseudofs_vnops.c index 9482db7277a2..347513fc19dc 100644 --- a/sys/fs/pseudofs/pseudofs_vnops.c +++ b/sys/fs/pseudofs/pseudofs_vnops.c @@ -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);