This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new e9fe1f8 net: socket: Enable parameter check (addr and addrlen) in
getsockname.c
e9fe1f8 is described below
commit e9fe1f84af469568868c6e403b526b76e993f70f
Author: Masayuki Ishikawa <[email protected]>
AuthorDate: Fri Feb 21 15:37:25 2020 +0900
net: socket: Enable parameter check (addr and addrlen) in getsockname.c
Signed-off-by: Masayuki Ishikawa <[email protected]>
---
net/socket/getsockname.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/net/socket/getsockname.c b/net/socket/getsockname.c
index bed6217..ea314a1 100644
--- a/net/socket/getsockname.c
+++ b/net/socket/getsockname.c
@@ -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 */