mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2025-01-11 17:04:19 +01:00
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
2272d4a4cb
commit
c43cad1ac1
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=118045
@ -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