From: Paul Mackerras Date: Tue, 19 Dec 2006 08:38:14 +0000 (+0000) Subject: Fix bug in CHAP MS v2 handling where we didn't zero enough. X-Git-Tag: ppp-2.4.7~106 X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=commitdiff_plain;h=6eb63a6d40281b270c1fc56cf10452c4322daf67 Fix bug in CHAP MS v2 handling where we didn't zero enough. Changing the response parameter of the ChapMS2 function to an unsigned char * meant that using sizeof(*response) in a BZERO call was no longer correct. Instead we need to use MS_CHAP2_RESPONSE_LEN. Patch from Guillaume Knispel. --- diff --git a/pppd/chap_ms.c b/pppd/chap_ms.c index 75724c5..b8feeb8 100644 --- a/pppd/chap_ms.c +++ b/pppd/chap_ms.c @@ -74,7 +74,7 @@ * */ -#define RCSID "$Id: chap_ms.c,v 1.36 2006/05/21 11:56:40 paulus Exp $" +#define RCSID "$Id: chap_ms.c,v 1.37 2006/12/19 08:38:14 paulus Exp $" #ifdef CHAPMS @@ -852,7 +852,7 @@ ChapMS2(u_char *rchallenge, u_char *PeerChallenge, u_char *p = &response[MS_CHAP2_PEER_CHALLENGE]; int i; - BZERO(response, sizeof(*response)); + BZERO(response, MS_CHAP2_RESPONSE_LEN); /* Generate the Peer-Challenge if requested, or copy it if supplied. */ if (!PeerChallenge)