Added memory checks

This commit is contained in:
Luca Deri
2020-08-02 13:00:31 +02:00
parent 57e28e03ee
commit ea10b8e757
3 changed files with 36 additions and 27 deletions
+2 -1
View File
@@ -479,7 +479,8 @@ static void processCertificateElements(struct ndpi_detection_module_struct *ndpi
}
}
if(rdn_len) flow->protos.stun_ssl.ssl.subjectDN = ndpi_strdup(rdnSeqBuf);
if(rdn_len && (flow->protos.stun_ssl.ssl.subjectDN == NULL))
flow->protos.stun_ssl.ssl.subjectDN = ndpi_strdup(rdnSeqBuf);
if(flow->protos.stun_ssl.ssl.subjectDN && flow->protos.stun_ssl.ssl.issuerDN
&& (!strcmp(flow->protos.stun_ssl.ssl.subjectDN, flow->protos.stun_ssl.ssl.issuerDN)))