Added check for removing characters from nDPI custom-defined protocols that might cause apps to misbehave.

This commit is contained in:
Luca Deri
2015-07-16 21:01:30 +02:00
parent e98108a8be
commit 73358d5ec2
2 changed files with 16 additions and 1 deletions
+1 -1
View File
@@ -13,7 +13,7 @@ tcp:3000@ntop
host:"googlesyndacation.com"@Google
host:"venere.com"@Venere
host:"kataweb.it",host:"repubblica.it"@Repubblica
host:"ntop"@ntop
# IP based Subprotocols
# Format:
# ip:<value>,ip:<value>,.....@<subproto>
+15
View File
@@ -2000,6 +2000,21 @@ int ndpi_handle_rule(struct ndpi_detection_module_struct *ndpi_mod, char* rule,
} else
at[0] = 0, proto = &at[1];
for(i=0; proto[i] != '\0'; i++) {
switch(proto[i]) {
case '/':
case '&':
case '^':
case ':':
case ';':
case '\'':
case '"':
case ' ':
proto[i] = '_';
break;
}
}
for(i=0, def = NULL; i<(int)ndpi_mod->ndpi_num_supported_protocols; i++) {
if(strcasecmp(ndpi_mod->proto_defaults[i].protoName, proto) == 0) {
def = &ndpi_mod->proto_defaults[i];