aboutsummaryrefslogtreecommitdiff
path: root/example/reader_util.c
diff options
context:
space:
mode:
authorLuca Deri <lucaderi@users.noreply.github.com>2020-07-13 10:23:06 +0200
committerGitHub <noreply@github.com>2020-07-13 10:23:06 +0200
commit051bdb19574ebf994b6d861cbe2fa3b098c7748d (patch)
tree3d571525efd3d37418994d712c1a2d9393d6ad61 /example/reader_util.c
parent12abcd516b468f6e0070308fa57052b93aa3a3ca (diff)
parent96c193cf795fbe7b55f8633404884099fcdc0d80 (diff)
Merge pull request #960 from lnslbrty/fix/heap-overflow-in-llc-readear-util
Fixed heap overflow caused by missing lengthcheck in 802.11 LLC heade…
Diffstat (limited to 'example/reader_util.c')
-rw-r--r--example/reader_util.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/example/reader_util.c b/example/reader_util.c
index 55dc0c667..9ad70ea53 100644
--- a/example/reader_util.c
+++ b/example/reader_util.c
@@ -1686,6 +1686,8 @@ struct ndpi_proto ndpi_workflow_process_packet(struct ndpi_workflow * workflow,
break;
/* Check ether_type from LLC */
+ if(header->caplen < (eth_offset + wifi_len + radio_len + sizeof(struct ndpi_llc_header_snap)))
+ return(nproto);
llc = (struct ndpi_llc_header_snap*)(packet + eth_offset + wifi_len + radio_len);
if(llc->dsap == SNAP)
type = ntohs(llc->snap.proto_ID);