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:
scottl 2003-07-26 07:23:24 +00:00
parent 79fc7c81b1
commit d7b9b07222
3 changed files with 6 additions and 0 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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);