mirror of https://gitee.com/openkylin/ppp.git
[PATCH] pppd: Fix bounds check in EAP code
Given that we have just checked vallen < len, it can never be the case that vallen >= len + sizeof(rhostname). This fixes the check so we actually avoid overflowing the rhostname array. Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com> Signed-off-by: Paul Mackerras <paulus@ozlabs.org> Gbp-Pq: Name CVE-2020-8597.patch
This commit is contained in:
parent
6437c3873b
commit
beb718d338
|
@ -1661,7 +1661,7 @@ int len;
|
|||
}
|
||||
|
||||
/* Not so likely to happen. */
|
||||
if (vallen >= len + sizeof (rhostname)) {
|
||||
if (len - vallen >= sizeof (rhostname)) {
|
||||
dbglog("EAP: trimming really long peer name down");
|
||||
BCOPY(inp + vallen, rhostname, sizeof (rhostname) - 1);
|
||||
rhostname[sizeof (rhostname) - 1] = '\0';
|
||||
|
@ -2251,7 +2251,7 @@ int len;
|
|||
}
|
||||
|
||||
/* Not so likely to happen. */
|
||||
if (vallen >= len + sizeof (rhostname)) {
|
||||
if (len - vallen >= sizeof (rhostname)) {
|
||||
dbglog("EAP: trimming really long peer name down");
|
||||
BCOPY(inp + vallen, rhostname, sizeof (rhostname) - 1);
|
||||
rhostname[sizeof (rhostname) - 1] = '\0';
|
||||
|
|
Loading…
Reference in New Issue