Guard against MLEN growing larger than a uint8_t due to MSIZE grwoing to a
value of 512 in LINT. This keeps gcc from complaining.
This commit is contained in:
parent
79fc7c81b1
commit
d7b9b07222
@ -626,8 +626,10 @@ sbappendaddr(sb, asa, m0, control)
|
||||
space += m_length(control, &n);
|
||||
if (space > sbspace(sb))
|
||||
return (0);
|
||||
#if MSIZE <= 256
|
||||
if (asa->sa_len > MLEN)
|
||||
return (0);
|
||||
#endif
|
||||
MGET(m, M_DONTWAIT, MT_SONAME);
|
||||
if (m == 0)
|
||||
return (0);
|
||||
|
@ -626,8 +626,10 @@ sbappendaddr(sb, asa, m0, control)
|
||||
space += m_length(control, &n);
|
||||
if (space > sbspace(sb))
|
||||
return (0);
|
||||
#if MSIZE <= 256
|
||||
if (asa->sa_len > MLEN)
|
||||
return (0);
|
||||
#endif
|
||||
MGET(m, M_DONTWAIT, MT_SONAME);
|
||||
if (m == 0)
|
||||
return (0);
|
||||
|
@ -120,8 +120,10 @@ vfs_hang_addrlist(mp, nep, argp)
|
||||
return (0);
|
||||
}
|
||||
|
||||
#if MSIZE <= 256
|
||||
if (argp->ex_addrlen > MLEN)
|
||||
return (EINVAL);
|
||||
#endif
|
||||
|
||||
i = sizeof(struct netcred) + argp->ex_addrlen + argp->ex_masklen;
|
||||
np = (struct netcred *) malloc(i, M_NETADDR, M_WAITOK | M_ZERO);
|
||||
|
Loading…
Reference in New Issue
Block a user