Skip to content

Commit

Permalink
fix: Handle null buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
JamieHunter committed Apr 15, 2022
1 parent f3b0d54 commit 4d7361a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/pkcs11/pkcs11_cert.c
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,10 @@ CK_RV pkcs11_cert_get_subject_key_id(CK_VOID_PTR pObject, CK_ATTRIBUTE_PTR pAttr
else
{
pAttribute->ulValueLen = 20;
if (pAttribute->pValue == NULL)
{
return CKR_OK;
}
}
}
else
Expand Down Expand Up @@ -392,7 +396,7 @@ static CK_RV pkcs11_cert_get_id(CK_VOID_PTR pObject, CK_ATTRIBUTE_PTR pAttribute
}
else
{
return pkcs11_attrib_empty(NULL, pAttribute);
return pkcs11_attrib_empty(pObject, pAttribute);
}
}
return rv;
Expand Down

0 comments on commit 4d7361a

Please sign in to comment.