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;
|
||||
}
|
||||
|
||||
/* Some sanity checking... Shouldn't need this on a buckled up embedded
|
||||
* system (?)
|
||||
*/
|
||||
/* Some sanity checking... */
|
||||
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
if (addr == NULL || *addrlen <= 0)
|
||||
if (addr == NULL || addrlen == NULL)
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Let the address family's send() method handle the operation */
|
||||
|
||||
|
|
Loading…
Reference in New Issue