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
f34a9421b1
commit
a9a8ba3d71
@ -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