Skip to content

Commit 4d7361a

Browse files
committed
fix: Handle null buffer
1 parent f3b0d54 commit 4d7361a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/pkcs11/pkcs11_cert.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,10 @@ CK_RV pkcs11_cert_get_subject_key_id(CK_VOID_PTR pObject, CK_ATTRIBUTE_PTR pAttr
335335
else
336336
{
337337
pAttribute->ulValueLen = 20;
338+
if (pAttribute->pValue == NULL)
339+
{
340+
return CKR_OK;
341+
}
338342
}
339343
}
340344
else
@@ -392,7 +396,7 @@ static CK_RV pkcs11_cert_get_id(CK_VOID_PTR pObject, CK_ATTRIBUTE_PTR pAttribute
392396
}
393397
else
394398
{
395-
return pkcs11_attrib_empty(NULL, pAttribute);
399+
return pkcs11_attrib_empty(pObject, pAttribute);
396400
}
397401
}
398402
return rv;

0 commit comments

Comments
 (0)