X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Fplugins%2Frp-pppoe%2Fcommon.c;h=9ea7fd609c8774aafbaf2cbe9bb6a6d86679b516;hb=f1e3aa2dc7e7772d8491c6ff61e4e6d28af33d4b;hp=8f175ece345b67bb4d276131aa97f1fce139d31c;hpb=c9d9dbfb8459b528ab56bd1cf0c41460801bbfdf;p=ppp.git diff --git a/pppd/plugins/rp-pppoe/common.c b/pppd/plugins/rp-pppoe/common.c index 8f175ec..9ea7fd6 100644 --- a/pppd/plugins/rp-pppoe/common.c +++ b/pppd/plugins/rp-pppoe/common.c @@ -65,7 +65,7 @@ parsePacket(PPPoEPacket *packet, ParseFunc *func, void *extra) /* Step through the tags */ curTag = packet->payload; - while(curTag - packet->payload < len) { + while (curTag - packet->payload + TAG_HDR_SIZE <= len) { /* Alignment is not guaranteed, so do this by hand... */ tagType = (curTag[0] << 8) + curTag[1]; tagLen = (curTag[2] << 8) + curTag[3];