summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--accel-pppd/ctrl/pppoe/pppoe.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/accel-pppd/ctrl/pppoe/pppoe.c b/accel-pppd/ctrl/pppoe/pppoe.c
index 12c274bb..092f0f32 100644
--- a/accel-pppd/ctrl/pppoe/pppoe.c
+++ b/accel-pppd/ctrl/pppoe/pppoe.c
@@ -487,6 +487,17 @@ static void print_packet(uint8_t *pack)
for (n = 0; n < ntohs(hdr->length); n += sizeof(*tag) + ntohs(tag->tag_len)) {
tag = (struct pppoe_tag *)(pack + ETH_HLEN + sizeof(*hdr) + n);
+
+ if (n + sizeof(*tag) > ntohs(hdr->length)) {
+ log_info2(" ...");
+ break;
+ }
+
+ if (n + sizeof(*tag) + ntohs(tag->tag_len) > ntohs(hdr->length)) {
+ log_info2(" ...");
+ break;
+ }
+
switch (ntohs(tag->tag_type)) {
case TAG_END_OF_LIST:
log_info2(" <End-Of-List>");