diff options
Diffstat (limited to 'src/lib/protocols')
-rw-r--r-- | src/lib/protocols/btlib.c | 2 | ||||
-rw-r--r-- | src/lib/protocols/eaq.c | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/lib/protocols/btlib.c b/src/lib/protocols/btlib.c index 309a10717..71b4dff9a 100644 --- a/src/lib/protocols/btlib.c +++ b/src/lib/protocols/btlib.c @@ -423,7 +423,7 @@ const u_int8_t *bt_decode(const u_int8_t *b, size_t *l, int *ret, bt_parse_data_ int64_t d = 0; u_int8_t c; - if(*l == 0) return NULL; + if(!l || *l == 0) return NULL; if(cbd->level > BDEC_MAXDEPT) goto bad_data; c = *b++; (*l)--; if(c == 'i') { // integer diff --git a/src/lib/protocols/eaq.c b/src/lib/protocols/eaq.c index 8768cac6f..e86b83181 100644 --- a/src/lib/protocols/eaq.c +++ b/src/lib/protocols/eaq.c @@ -41,7 +41,15 @@ static void ndpi_int_eaq_add_connection(struct ndpi_detection_module_struct *ndp void ndpi_search_eaq(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { + if (!flow) { + return; + } + struct ndpi_packet_struct *packet = &flow->packet; + if (!packet) { + return; + } + u_int16_t sport = ntohs(packet->udp->source), dport = ntohs(packet->udp->dest); NDPI_LOG_DBG(ndpi_struct, "search eaq\n"); |