crypto: use X509V3_EXT_d2i · nodejs/node@af63b38

Original file line numberDiff line numberDiff line change

@@ -1463,12 +1463,7 @@ static bool SafeX509ExtPrint(BIO* out, X509_EXTENSION* ext) {

14631463

if (method != X509V3_EXT_get_nid(NID_subject_alt_name))

14641464

return false;

14651465
1466-

const unsigned char* p = ext->value->data;

1467-

GENERAL_NAMES* names = reinterpret_cast<GENERAL_NAMES*>(ASN1_item_d2i(

1468-

NULL,

1469-

&p,

1470-

ext->value->length,

1471-

ASN1_ITEM_ptr(method->it)));

1466+

GENERAL_NAMES* names = static_cast<GENERAL_NAMES*>(X509V3_EXT_d2i(ext));

14721467

if (names == NULL)

14731468

return false;

14741469