diff --git a/src/file_analysis/analyzer/x509/functions.bif b/src/file_analysis/analyzer/x509/functions.bif index 95ee203e8b..fb49705bf8 100644 --- a/src/file_analysis/analyzer/x509/functions.bif +++ b/src/file_analysis/analyzer/x509/functions.bif @@ -1088,6 +1088,11 @@ function x509_check_cert_hostname%(cert_opaque: opaque of x509, hostname: string { char buf[2048]; BIO *bio = BIO_new(BIO_s_mem()); + if ( ! bio ) + { + zeek::emit_builtin_error(zeek::util::fmt("Could create bio")); + return zeek::make_intrusive(""); + } ASN1_STRING_print(bio, X509_NAME_ENTRY_get_data(X509_NAME_get_entry(subject, found_nid))); size_t len = BIO_gets(bio, buf, sizeof(buf)); BIO_free(bio);