Don't allow reads past the end of a file.
Submitted by: John Wehle, Andriy Gapon MFC After: 3 days
This commit is contained in:
parent
972d9bed42
commit
d1022c068e
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user