diff --git a/src/node_crypto.cc b/src/node_crypto.cc index 9006f3e12c664b..968f7a8f629808 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -1477,12 +1477,7 @@ static bool SafeX509ExtPrint(BIO* out, X509_EXTENSION* ext) { if (method != X509V3_EXT_get_nid(NID_subject_alt_name)) return false; - const unsigned char* p = ext->value->data; - GENERAL_NAMES* names = reinterpret_cast(ASN1_item_d2i( - NULL, - &p, - ext->value->length, - ASN1_ITEM_ptr(method->it))); + GENERAL_NAMES* names = static_cast(X509V3_EXT_d2i(ext)); if (names == NULL) return false;