Linuxulator getpeername() returns EINVAL in case then namelen less then 0.

MFC after:	2 weeks
This commit is contained in:
Dmitry Chagin 2019-05-13 18:14:20 +00:00
parent adbb25df4b
commit caaad8736e

View File

@ -722,6 +722,8 @@ linux_getpeername(struct thread *td, struct linux_getpeername_args *args)
error = copyin(PTRIN(args->namelen), &len, sizeof(len));
if (error != 0)
return (error);
if (len < 0)
return (EINVAL);
error = kern_getpeername(td, args->s, &sa, &len);
if (error != 0)