Fixed SEGV with undepcified protos

This commit is contained in:
Luca Deri 2018-07-22 21:06:10 +02:00
parent 659649d2e9
commit 49ed41142c

View file

@ -2503,7 +2503,7 @@ int ndpi_handle_rule(struct ndpi_detection_module_struct *ndpi_mod,
}
for(i=0, def = NULL; i<(int)ndpi_mod->ndpi_num_supported_protocols; i++) {
if(strcasecmp(ndpi_mod->proto_defaults[i].protoName, proto) == 0) {
if(ndpi_mod->proto_defaults[i].protoName && strcasecmp(ndpi_mod->proto_defaults[i].protoName, proto) == 0) {
def = &ndpi_mod->proto_defaults[i];
subprotocol_id = i;
break;