Arbitrarily limit to 64k the number of bytes that can be read at
a time using the ogetdirentries() compatibility syscall. This is a hack to ensure that rediculous values don't get passed to MALLOC(). Reviewed by: kris
This commit is contained in:
parent
15e90b8fd6
commit
c44cbf0fd7
@ -3059,6 +3059,9 @@ ogetdirentries(p, uap)
|
||||
int error, eofflag, readcnt;
|
||||
long loff;
|
||||
|
||||
/* XXX arbitrary sanity limit on `count'. */
|
||||
if (SCARG(uap, count) > 64 * 1024)
|
||||
return (EINVAL);
|
||||
if ((error = getvnode(p->p_fd, SCARG(uap, fd), &fp)) != 0)
|
||||
return (error);
|
||||
if ((fp->f_flag & FREAD) == 0)
|
||||
|
@ -3059,6 +3059,9 @@ ogetdirentries(p, uap)
|
||||
int error, eofflag, readcnt;
|
||||
long loff;
|
||||
|
||||
/* XXX arbitrary sanity limit on `count'. */
|
||||
if (SCARG(uap, count) > 64 * 1024)
|
||||
return (EINVAL);
|
||||
if ((error = getvnode(p->p_fd, SCARG(uap, fd), &fp)) != 0)
|
||||
return (error);
|
||||
if ((fp->f_flag & FREAD) == 0)
|
||||
|
Loading…
Reference in New Issue
Block a user