Fixed bug #13315 (PPP PAP authentication can result in erroneous callbacks) by copying the code from recent pppd

This commit is contained in:
goldsimon 2010-01-11 16:38:56 +00:00
parent 9a2d97ec41
commit 68ddcc6ca7
2 changed files with 16 additions and 11 deletions

View File

@ -41,6 +41,10 @@ HISTORY
++ Bugfixes:
2010-01-11: Simon Goldschmidt
* pap.c: Fixed bug #13315 (PPP PAP authentication can result in
erroneous callbacks) by copying the code from recent pppd
2010-01-10: Simon Goldschmidt
* raw.c: Fixed bug #28506 (raw_bind should filter received packets)

View File

@ -452,18 +452,19 @@ upap_rauthack(upap_state *u, u_char *inp, int id, int len)
* Parse message.
*/
if (len < sizeof (u_char)) {
UPAPDEBUG((LOG_INFO, "pap_rauthack: rcvd short packet.\n"));
return;
UPAPDEBUG((LOG_INFO, "pap_rauthack: ignoring missing msg-length.\n"));
} else {
GETCHAR(msglen, inp);
if (msglen > 0) {
len -= sizeof (u_char);
if (len < msglen) {
UPAPDEBUG((LOG_INFO, "pap_rauthack: 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_rauthack: rcvd short packet.\n"));
return;
}
msg = (char *) inp;
PRINTMSG(msg, msglen);
UNTIMEOUT(upap_timeout, u); /* Cancel timeout */
u->us_clientstate = UPAPCS_OPEN;