mirror of
https://github.com/openssl/openssl.git
synced 2025-04-06 20:20:50 +08:00
apps/cms.c, apps/ocsp.c: Added NULL pointer checks
Reviewed-by: Paul Dale <ppzgs1@gmail.com> Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/27059)
This commit is contained in:
parent
207cd5bb97
commit
952d9b83b2
@ -1011,7 +1011,7 @@ int cms_main(int argc, char **argv)
|
||||
goto end;
|
||||
|
||||
pctx = CMS_RecipientInfo_get0_pkey_ctx(ri);
|
||||
if (kparam != NULL) {
|
||||
if (pctx != NULL && kparam != NULL) {
|
||||
if (!cms_set_pkey_param(pctx, kparam->param))
|
||||
goto end;
|
||||
}
|
||||
|
@ -1049,6 +1049,10 @@ static void make_ocsp_response(BIO *err, OCSP_RESPONSE **resp, OCSP_REQUEST *req
|
||||
}
|
||||
|
||||
bs = OCSP_BASICRESP_new();
|
||||
if (bs == NULL) {
|
||||
*resp = OCSP_response_create(OCSP_RESPONSE_STATUS_INTERNALERROR, bs);
|
||||
goto end;
|
||||
}
|
||||
thisupd = X509_gmtime_adj(NULL, 0);
|
||||
if (ndays != -1)
|
||||
nextupd = X509_time_adj_ex(NULL, ndays, nmin * 60, NULL);
|
||||
|
Loading…
x
Reference in New Issue
Block a user