Fix invalid memory read
This commit is contained in:
@@ -153,8 +153,10 @@ void ndpi_search_mail_smtp_tcp(struct ndpi_detection_module_struct *ndpi_struct,
|
|||||||
out = ndpi_base64_decode((const u_char*)buf, (size_t)strlen((const char*)buf), &out_len);
|
out = ndpi_base64_decode((const u_char*)buf, (size_t)strlen((const char*)buf), &out_len);
|
||||||
|
|
||||||
if(out) {
|
if(out) {
|
||||||
snprintf(flow->protos.ftp_imap_pop_smtp.username,
|
size_t len = ndpi_min(out_len, sizeof(flow->protos.ftp_imap_pop_smtp.username) - 1);
|
||||||
sizeof(flow->protos.ftp_imap_pop_smtp.username), "%s", out);
|
|
||||||
|
memcpy(flow->protos.ftp_imap_pop_smtp.username, out, len);
|
||||||
|
flow->protos.ftp_imap_pop_smtp.username[len] = '\0';
|
||||||
|
|
||||||
ndpi_free(out);
|
ndpi_free(out);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user