You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think the condition of 'addr->len < sizeof(cu->cu_raddr)' is normal while the addr is for IPV4.
We should avoid the condition of 'addr->len > sizeof(cu->cu_raddr)' to prevent memory access out of bounds at '(void)memcpy(&cu->cu_raddr, addr->buf, addr->len);'
Is 'if (addr->len < sizeof(cu->cu_raddr)) ' supposed to be 'if (addr->len > sizeof(cu->cu_raddr)) ' ?
The text was updated successfully, but these errors were encountered:
No, the API here takes a struct sockaddr_storage, so that it can easily handle all address types. You're right that we should be checking the max length, so if anything the check should be
(addr->len != sizeof(cu->raddr))
zhengyf
changed the title
There's some cinfusion about line 335 of clnt_dg.c
There's some confusion about line 335 of clnt_dg.c
May 25, 2018
ntirpc/src/clnt_dg.c
Line 335 in dba123c
Let's see the code as follows
I think the condition of '
addr->len < sizeof(cu->cu_raddr)
' is normal while the addr is for IPV4.We should avoid the condition of '
addr->len > sizeof(cu->cu_raddr)
' to prevent memory access out of bounds at '(void)memcpy(&cu->cu_raddr, addr->buf, addr->len);
'Is '
if (addr->len < sizeof(cu->cu_raddr))
' supposed to be 'if (addr->len > sizeof(cu->cu_raddr))
' ?The text was updated successfully, but these errors were encountered: