Added check on payload len (#227)

This commit is contained in:
Luca Deri 2016-07-12 16:05:49 +02:00
parent 4fe8d350a2
commit a93c83fe6b

View file

@ -44,7 +44,7 @@ void ndpi_search_git(struct ndpi_detection_module_struct *ndpi_struct,
memcpy(&len, &pp[offset], 4), len[4] = 0;
git_pkt_len = atoi(len);
if(payload_len < git_pkt_len) {
if((payload_len < git_pkt_len) || (git_pkt_len == 0 /* Bad */)) {
found_git = 0;
break;
} else