diff options
author | Dmitry Kozlov <xeb@mail.ru> | 2013-07-05 15:04:26 +0400 |
---|---|---|
committer | Dmitry Kozlov <xeb@mail.ru> | 2013-07-05 15:04:26 +0400 |
commit | 5b095342160fc5c7e7e5a42b202a2e7d535bb757 (patch) | |
tree | 74edc2e6546f4d48bf5e34d1827155aff5e8bd29 /accel-pppd/auth/auth_mschap_v2.c | |
parent | d9e3b3f468475c5e1c81e65b70806f7d20c7a893 (diff) | |
download | accel-ppp-5b095342160fc5c7e7e5a42b202a2e7d535bb757.tar.gz accel-ppp-5b095342160fc5c7e7e5a42b202a2e7d535bb757.zip |
auth_chap: fixed incorrect check for received buffer size
Diffstat (limited to 'accel-pppd/auth/auth_mschap_v2.c')
-rw-r--r-- | accel-pppd/auth/auth_mschap_v2.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/accel-pppd/auth/auth_mschap_v2.c b/accel-pppd/auth/auth_mschap_v2.c index 444a9df2..3ee2adc3 100644 --- a/accel-pppd/auth/auth_mschap_v2.c +++ b/accel-pppd/auth/auth_mschap_v2.c @@ -607,7 +607,7 @@ static void chap_recv(struct ppp_handler_t *h) struct chap_auth_data_t *d = container_of(h, typeof(*d), h); struct chap_hdr_t *hdr = (struct chap_hdr_t *)d->ppp->buf; - if (d->ppp->buf_size < sizeof(*hdr) || ntohs(hdr->len) < HDR_LEN || ntohs(hdr->len) < d->ppp->buf_size - 2) { + if (d->ppp->buf_size < sizeof(*hdr) || ntohs(hdr->len) < HDR_LEN || ntohs(hdr->len) > d->ppp->buf_size - 2) { log_ppp_warn("mschap-v2: short packet received\n"); return; } |