summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--usr.sbin/ppp/lqr.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/ppp/lqr.c b/usr.sbin/ppp/lqr.c
index 3e9f0f6..dad0e46 100644
--- a/usr.sbin/ppp/lqr.c
+++ b/usr.sbin/ppp/lqr.c
@@ -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);
OpenPOWER on IntegriCloud