diff options
author | Luca Deri <lucaderi@users.noreply.github.com> | 2018-04-16 14:16:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-16 14:16:09 +0200 |
commit | 8a59581668047ec0a8c9d5ed778476c398ab7f89 (patch) | |
tree | b5e1dee3ea7d0892b87108264811863a07105842 /src/lib/protocols/tor.c | |
parent | d8e4111a9d4158af8246d66d4ab82cbcd990ea6a (diff) | |
parent | 5950ad7ef82c329c56d17c11e9b34810180a7c16 (diff) |
Merge pull request #547 from zyingp/free-after-detect
Fix several bugs found by Address Sanitizer (ASan)
Diffstat (limited to 'src/lib/protocols/tor.c')
-rw-r--r-- | src/lib/protocols/tor.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/protocols/tor.c b/src/lib/protocols/tor.c index 21fc0cf52..462833db0 100644 --- a/src/lib/protocols/tor.c +++ b/src/lib/protocols/tor.c @@ -31,7 +31,7 @@ int ndpi_is_ssl_tor(struct ndpi_detection_module_struct *ndpi_struct, len = strlen(certificate); /* Check if it ends in .com or .net */ - if(strcmp(&certificate[len-4], ".com") && strcmp(&certificate[len-4], ".net")) + if(len>=4 && strcmp(&certificate[len-4], ".com") && strcmp(&certificate[len-4], ".net")) return(0); if((len < 6) |