net: socket: Enable parameter check (addr and addrlen) in getsockname.c
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
This commit is contained in:
parent
fd3e2c5916
commit
e9fe1f84af
|
@ -101,16 +101,12 @@ int psock_getsockname(FAR struct socket *psock, FAR struct sockaddr *addr,
|
||||||
return -EBADF;
|
return -EBADF;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Some sanity checking... Shouldn't need this on a buckled up embedded
|
/* Some sanity checking... */
|
||||||
* system (?)
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef CONFIG_DEBUG_FEATURES
|
if (addr == NULL || addrlen == NULL)
|
||||||
if (addr == NULL || *addrlen <= 0)
|
|
||||||
{
|
{
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Let the address family's send() method handle the operation */
|
/* Let the address family's send() method handle the operation */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue