aboutsummaryrefslogtreecommitdiff
path: root/src/lib/protocols/tor.c
diff options
context:
space:
mode:
authorLuca Deri <deri@ntop.org>2019-08-22 20:04:15 +0200
committerLuca Deri <deri@ntop.org>2019-08-22 20:04:15 +0200
commit2134f83948b629640b4c372dfdfc9f2eaf7b20a2 (patch)
treec6ecb403fbf7447ec993fc29b6458eebcaa3500e /src/lib/protocols/tor.c
parent3d3cae1f205bdac6187e33718bd919d3d61e1b16 (diff)
Warning fixes
Diffstat (limited to 'src/lib/protocols/tor.c')
-rw-r--r--src/lib/protocols/tor.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/protocols/tor.c b/src/lib/protocols/tor.c
index 3b2dd06c4..b3070d0b9 100644
--- a/src/lib/protocols/tor.c
+++ b/src/lib/protocols/tor.c
@@ -20,7 +20,7 @@ static void ndpi_int_tor_add_connection(struct ndpi_detection_module_struct
int ndpi_is_tls_tor(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow, char *certificate) {
- int prev_num = 0, numbers_found = 0, num_found = 0, i, len, num_impossible = 0;
+ int len;
char dummy[48], *dot, *name;
if((certificate == NULL) || (certificate[0] == '\0'))
@@ -51,6 +51,8 @@ int ndpi_is_tls_tor(struct ndpi_detection_module_struct *ndpi_struct,
len = strlen(name);
if(len >= 5) {
+ int i, prev_num = 0, numbers_found = 0, num_found = 0, num_impossible = 0;
+
for(i = 0; name[i+1] != '\0'; i++) {
// printf("***** [SSL] %s(): [%d][%c]", __FUNCTION__, i, name[i]);
@@ -66,7 +68,6 @@ int ndpi_is_tls_tor(struct ndpi_detection_module_struct *ndpi_struct,
}
} else
prev_num = 0;
-
if(ndpi_match_bigram(ndpi_struct, &ndpi_struct->bigrams_automa, &name[i])) {
num_found++;