Add length check before checking a Tor certificate name

This commit is contained in:
Yingpei Zeng
2018-04-16 16:01:31 +08:00
parent 076bd3d1f4
commit 480791a057
+1 -1
View File
@@ -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)