X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Fupap.c;h=4e5c045a71ce344a465d0804586e24164c4469ae;hb=33c08b5f78f41aab4d1172e66db7c1afe21b5f1c;hp=6bf8dece21411fc3cc94c89a99683485b9499f45;hpb=4faf67061e6954ee068278dc0b8155207771c316;p=ppp.git diff --git a/pppd/upap.c b/pppd/upap.c index 6bf8dec..4e5c045 100644 --- a/pppd/upap.c +++ b/pppd/upap.c @@ -17,7 +17,7 @@ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ -#define RCSID "$Id: upap.c,v 1.20 1999/08/24 05:29:26 paulus Exp $" +#define RCSID "$Id: upap.c,v 1.22 1999/11/15 01:51:53 paulus Exp $" /* * TODO: @@ -372,7 +372,7 @@ upap_rauthreq(u, inp, id, len) /* * Parse user/passwd. */ - if (len < sizeof (u_char)) { + if (len < 1) { UPAPDEBUG(("pap_rauth: rcvd short packet.")); return; } @@ -395,8 +395,11 @@ upap_rauthreq(u, inp, id, len) * Check the username and password given. */ retcode = check_passwd(u->us_unit, ruser, ruserlen, rpasswd, - rpasswdlen, &msg, &msglen); + rpasswdlen, &msg); BZERO(rpasswd, rpasswdlen); + msglen = strlen(msg); + if (msglen > 255) + msglen = 255; upap_sresp(u, retcode, id, msg, msglen); @@ -432,7 +435,7 @@ upap_rauthack(u, inp, id, len) /* * Parse message. */ - if (len < sizeof (u_char)) { + if (len < 1) { UPAPDEBUG(("pap_rauthack: ignoring missing msg-length.")); } else { GETCHAR(msglen, inp); @@ -472,7 +475,7 @@ upap_rauthnak(u, inp, id, len) /* * Parse message. */ - if (len < sizeof (u_char)) { + if (len < 1) { UPAPDEBUG(("pap_rauthnak: ignoring missing msg-length.")); } else { GETCHAR(msglen, inp);