mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-20 19:45:20 +00:00
Check for invalid arguments
Caused crash when recvfrom was using null buffer
This commit is contained in:
parent
149c08ba78
commit
08c9a7c184
1 changed files with 6 additions and 0 deletions
|
@ -444,6 +444,12 @@ namespace sys_net
|
|||
memcpy(&_addr, addr.get_ptr(), sizeof(::sockaddr));
|
||||
_addr.sa_family = addr->sa_family;
|
||||
|
||||
if (!sock || !buf || len == 0)
|
||||
{
|
||||
libnet.error("recvfrom(): invalid arguments buf= *0x%x, len=%d", buf, len);
|
||||
return SYS_NET_EINVAL;
|
||||
}
|
||||
|
||||
if (s < 0) {
|
||||
libnet.error("recvfrom(): invalid socket %d", s);
|
||||
return SYS_NET_EBADF;
|
||||
|
|
Loading…
Add table
Reference in a new issue