Fix a panic in pseudofs(9) that could occur when doing an I/O

operation with a large request or large offset.

Reported by:	Joel Ray Holveck <joelh@piquan.org>
Submitted by:	des
This commit is contained in:
nectar 2004-02-10 21:06:47 +00:00
parent 788d9119de
commit a96542610a

View File

@ -525,6 +525,11 @@ pfs_read(struct vop_read_args *va)
PRELE(proc);
PFS_RETURN (EINVAL);
}
if (buflen > MAXPHYS) {
if (proc != NULL)
PRELE(proc);
PFS_RETURN (EIO);
}
sb = sbuf_new(sb, NULL, buflen, 0);
if (sb == NULL) {
if (proc != NULL)