check on allocation of new node before dereferencing

This commit is contained in:
JacobBarthelmeh
2023-06-07 15:20:23 -06:00
parent 84979900a7
commit 4a4a769512

View File

@ -13965,8 +13965,10 @@ int wolfSSL_X509_REQ_add1_attr_by_NID(WOLFSSL_X509 *req,
else {
if (req->reqAttributes == NULL) {
req->reqAttributes = wolfSSL_sk_new_node(req->heap);
if (req->reqAttributes != NULL) {
req->reqAttributes->type = STACK_TYPE_X509_REQ_ATTR;
}
}
ret = wolfSSL_sk_push(req->reqAttributes, attr);
}