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).
This commit is contained in:
parent
b12f693b8b
commit
957831d2ba
@ -89,7 +89,14 @@ ssize_t psock_send(FAR struct socket *psock, FAR const void *buf, size_t len,
|
|||||||
{
|
{
|
||||||
ssize_t ret;
|
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 */
|
/* 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;
|
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
|
/* If to is NULL or tolen is zero, then this function is same as send (for
|
||||||
* connected socket types)
|
* connected socket types)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user