Fixed bug #21680: PPP upap_rauthnak() drops legal NAK packets

This commit is contained in:
goldsimon 2009-05-01 12:10:34 +00:00
parent 217f279fdb
commit 23d7f5425d
2 changed files with 14 additions and 9 deletions

View File

@ -95,6 +95,9 @@ HISTORY
++ Bugfixes:
2009-05-01 Simon Goldschmidt
* pap.c: bug #21680: PPP upap_rauthnak() drops legal NAK packets
2009-05-01 Simon Goldschmidt
* ppp.c: bug #24228: Memory corruption with PPP and DHCP

View File

@ -518,16 +518,18 @@ upap_rauthnak(upap_state *u, u_char *inp, int id, int len)
*/
if (len < sizeof (u_char)) {
UPAPDEBUG((LOG_INFO, "pap_rauthnak: rcvd short packet.\n"));
return;
} else {
GETCHAR(msglen, inp);
if(msglen > 0) {
len -= sizeof (u_char);
if (len < msglen) {
UPAPDEBUG((LOG_INFO, "pap_rauthnak: rcvd short packet.\n"));
return;
}
msg = (char *) inp;
PRINTMSG(msg, msglen);
}
}
GETCHAR(msglen, inp);
len -= sizeof (u_char);
if (len < msglen) {
UPAPDEBUG((LOG_INFO, "pap_rauthnak: rcvd short packet.\n"));
return;
}
msg = (char *) inp;
PRINTMSG(msg, msglen);
u->us_clientstate = UPAPCS_BADAUTH;