Prevent overflow of uio_resid.

Noted by:	jhb
MFC after:	3 days
This commit is contained in:
Konstantin Belousov 2009-05-11 19:58:03 +00:00
parent 1c6c0ed937
commit 3b616faed5

View File

@ -2596,6 +2596,9 @@ kern_readlinkat(struct thread *td, int fd, char *path, enum uio_seg pathseg,
struct nameidata nd;
int vfslocked;
if (count > INT_MAX)
return (EINVAL);
NDINIT_AT(&nd, LOOKUP, NOFOLLOW | LOCKSHARED | LOCKLEAF | MPSAFE |
AUDITVNODE1, pathseg, path, fd, td);