Skip to content
Snippets Groups Projects
Commit 957831d2 authored by Jussi Kivilinna's avatar Jussi Kivilinna Committed by Gregory Nutt
Browse files

net/socket: psock_send/psock_sendto: remove assert check for null psock and...

net/socket: psock_send/psock_sendto: remove assert check for null psock and buf input pointers.  Removes check as 'psock == NULL' altogether because that checked for later in psock_send and psock_sendto. Change null check for 'buf' so that it is handled same as in recvfrom.c (return -EINVAL instead of
assert).
parent b12f693b
No related branches found
No related tags found
No related merge requests found
......@@ -89,7 +89,14 @@ ssize_t psock_send(FAR struct socket *psock, FAR const void *buf, size_t len,
{
ssize_t ret;
DEBUGASSERT(psock != NULL && buf != NULL);
/* Verify that non-NULL pointers were passed */
#ifdef CONFIG_DEBUG_FEATURES
if (buf == NULL)
{
return -EINVAL;
}
#endif
/* Verify that the sockfd corresponds to valid, allocated socket */
......
......@@ -124,7 +124,14 @@ ssize_t psock_sendto(FAR struct socket *psock, FAR const void *buf,
{
ssize_t nsent;
DEBUGASSERT(psock != NULL && buf != NULL);
/* Verify that non-NULL pointers were passed */
#ifdef CONFIG_DEBUG_FEATURES
if (buf == NULL)
{
return -EINVAL;
}
#endif
/* If to is NULL or tolen is zero, then this function is same as send (for
* connected socket types)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment