diff options
author | 2000-06-20 09:13:31 +0000 | |
---|---|---|
committer | 2000-06-20 09:13:31 +0000 | |
commit | 085be0309e19793b88b71004e97cb56241018cc6 (patch) | |
tree | 3fbd53a9cdab70fcd6445514f2cb35372314f465 | |
parent | fix warnings during compilation. replace a few more calloc's with (diff) | |
download | wireguard-openbsd-085be0309e19793b88b71004e97cb56241018cc6.tar.xz wireguard-openbsd-085be0309e19793b88b71004e97cb56241018cc6.zip |
Allow padding in LQR ECHO requests
Problem found by: Tomaz Borstnar <tomaz.borstnar@over.net>
-rw-r--r-- | usr.sbin/ppp/ppp/lqr.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.sbin/ppp/ppp/lqr.c b/usr.sbin/ppp/ppp/lqr.c index 5a79f4e6a65..172c99797a0 100644 --- a/usr.sbin/ppp/ppp/lqr.c +++ b/usr.sbin/ppp/ppp/lqr.c @@ -17,7 +17,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $OpenBSD: lqr.c,v 1.9 2000/02/27 01:38:27 brian Exp $ + * $OpenBSD: lqr.c,v 1.10 2000/06/20 09:13:31 brian Exp $ * * o LQR based on RFC1333 * @@ -85,8 +85,9 @@ lqr_RecvEcho(struct fsm *fp, struct mbuf *bp) struct lcp *lcp = fsm2lcp(fp); struct echolqr lqr; - if (m_length(bp) == sizeof lqr) { - bp = mbuf_Read(bp, &lqr, sizeof lqr); + if (m_length(bp) >= sizeof lqr) { + m_freem(mbuf_Read(bp, &lqr, sizeof lqr)); + bp = NULL; lqr.magic = ntohl(lqr.magic); lqr.signature = ntohl(lqr.signature); lqr.sequence = ntohl(lqr.sequence); |