Allow padding in LQR ECHO requests

Problem found by: Tomaz Borstnar <tomaz.borstnar@over.net>
This commit is contained in:
Brian Somers 2000-06-20 09:13:25 +00:00
parent eb2671134a
commit bee32c7928
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=61852

View File

@ -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);