diff options
author | scottl <scottl@FreeBSD.org> | 2005-01-12 06:17:01 +0000 |
---|---|---|
committer | scottl <scottl@FreeBSD.org> | 2005-01-12 06:17:01 +0000 |
commit | 099bc757889a8b5debfd0c38677b347ee68a040b (patch) | |
tree | 6c751940e7c31e1b6e38b88091adb49cc2786249 /sys/fs/udf | |
parent | e49f75e9e4defe1c0d95b314207b4ed892adcd37 (diff) | |
download | FreeBSD-src-099bc757889a8b5debfd0c38677b347ee68a040b.zip FreeBSD-src-099bc757889a8b5debfd0c38677b347ee68a040b.tar.gz |
Don't allow reads past the end of a file.
Submitted by: John Wehle, Andriy Gapon
MFC After: 3 days
Diffstat (limited to 'sys/fs/udf')
-rw-r--r-- | sys/fs/udf/udf_vnops.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/fs/udf/udf_vnops.c b/sys/fs/udf/udf_vnops.c index 916fd5b..3916a3d 100644 --- a/sys/fs/udf/udf_vnops.c +++ b/sys/fs/udf/udf_vnops.c @@ -412,7 +412,7 @@ udf_read(struct vop_read_args *a) while (uio->uio_offset < fsize && uio->uio_resid > 0) { offset = uio->uio_offset; - size = uio->uio_resid; + size = min (uio->uio_resid, fsize - uio->uio_offset); error = udf_readatoffset(node, &size, offset, &bp, &data); if (error == 0) error = uiomove(data, size, uio); |