unix: turn check in unp_externalize() into assertion
In this function we always work with mbufs that we previously created ourselves in unp_internalize(). They must be valid. Reviewed by: markj Differential revision: https://reviews.freebsd.org/D35319
This commit is contained in:
parent
579b45e203
commit
4682ac697c
@ -2015,10 +2015,8 @@ unp_externalize(struct mbuf *control, struct mbuf **controlp, int flags)
|
||||
if (controlp != NULL) /* controlp == NULL => free control messages */
|
||||
*controlp = NULL;
|
||||
while (cm != NULL) {
|
||||
if (sizeof(*cm) > clen || cm->cmsg_len > clen) {
|
||||
error = EINVAL;
|
||||
break;
|
||||
}
|
||||
MPASS(clen >= sizeof(*cm) && clen <= cm->cmsg_len);
|
||||
|
||||
data = CMSG_DATA(cm);
|
||||
datalen = (caddr_t)cm + cm->cmsg_len - (caddr_t)data;
|
||||
if (cm->cmsg_level == SOL_SOCKET
|
||||
|
Loading…
Reference in New Issue
Block a user