summaryrefslogtreecommitdiffstats
path: root/sys/fs
diff options
context:
space:
mode:
authornetchild <netchild@FreeBSD.org>2006-06-27 20:21:38 +0000
committernetchild <netchild@FreeBSD.org>2006-06-27 20:21:38 +0000
commit1fbdab64b8df2ef5c7d7df24551c7d2db91b318c (patch)
tree1b94287d73824df5aefeaeee985e654ea185b5a5 /sys/fs
parentb9c4ec80c0afb1e149ed816a51422af63686a225 (diff)
downloadFreeBSD-src-1fbdab64b8df2ef5c7d7df24551c7d2db91b318c.zip
FreeBSD-src-1fbdab64b8df2ef5c7d7df24551c7d2db91b318c.tar.gz
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
Diffstat (limited to 'sys/fs')
-rw-r--r--sys/fs/pseudofs/pseudofs_vnops.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/fs/pseudofs/pseudofs_vnops.c b/sys/fs/pseudofs/pseudofs_vnops.c
index 9482db7..347513f 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);
OpenPOWER on IntegriCloud