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:
Scott Long 2003-07-26 07:23:24 +00:00
parent 2272d4a4cb
commit c43cad1ac1
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=118045
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);