aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Deri <deri@ntop.org>2021-10-07 08:21:40 +0200
committerLuca Deri <deri@ntop.org>2021-10-07 08:21:40 +0200
commit3ffb65a81c2e61650646d7382c8779f814993d0b (patch)
tree875ef7d6bfb9d80aa8de29371092d288c176efde
parent2dfc478ad476bdb3f774fe83ad90ccd6aa4ff7c3 (diff)
Added extra check
-rw-r--r--src/lib/protocols/mining.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/protocols/mining.c b/src/lib/protocols/mining.c
index f20ff7167..d4dbffbd0 100644
--- a/src/lib/protocols/mining.c
+++ b/src/lib/protocols/mining.c
@@ -49,7 +49,8 @@ void ndpi_search_mining_udp(struct ndpi_detection_module_struct *ndpi_struct,
Ethereum P2P Discovery Protocol
https://github.com/ConsenSys/ethereum-dissectors/blob/master/packet-ethereum-disc.c
*/
- if((packet->payload_packet_len > 98)
+ if(packet->udp
+ && (packet->payload_packet_len > 98)
&& (packet->payload_packet_len < 1280)
&& ((source == 30303) || (dest == 30303))
&& (packet->payload[97] <= 0x04 /* NODES */)
@@ -85,7 +86,7 @@ void ndpi_search_mining_tcp(struct ndpi_detection_module_struct *ndpi_struct,
NDPI_LOG_DBG(ndpi_struct, "search MINING TCP\n");
/* Check connection over TCP */
- if(packet->payload_packet_len > 10) {
+ if(packet->tcp && (packet->payload_packet_len > 10)) {
if(packet->tcp->source == htons(8333)) {
/*
Bitcoin