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:
Masayuki Ishikawa 2020-02-21 15:37:25 +09:00 committed by Xiang Xiao
parent fd3e2c5916
commit e9fe1f84af
1 changed files with 2 additions and 6 deletions

View File

@ -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 */