summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbrian <brian@openbsd.org>2000-06-20 09:13:31 +0000
committerbrian <brian@openbsd.org>2000-06-20 09:13:31 +0000
commit085be0309e19793b88b71004e97cb56241018cc6 (patch)
tree3fbd53a9cdab70fcd6445514f2cb35372314f465
parentfix warnings during compilation. replace a few more calloc's with (diff)
downloadwireguard-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.c7
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);