artulab
projects
/
openbsd
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
61bb619
)
Check return value from EVP_CIPHER_CTX_new in cms_pwri.c
author
inoguchi
<inoguchi@openbsd.org>
Wed, 19 Jan 2022 13:47:44 +0000
(13:47 +0000)
committer
inoguchi
<inoguchi@openbsd.org>
Wed, 19 Jan 2022 13:47:44 +0000
(13:47 +0000)
CID 345137
ok jsing@ tb@
lib/libcrypto/cms/cms_pwri.c
patch
|
blob
|
history
diff --git
a/lib/libcrypto/cms/cms_pwri.c
b/lib/libcrypto/cms/cms_pwri.c
index
cf28dfc
..
eb241a6
100644
(file)
--- a/
lib/libcrypto/cms/cms_pwri.c
+++ b/
lib/libcrypto/cms/cms_pwri.c
@@
-1,4
+1,4
@@
-/* $OpenBSD: cms_pwri.c,v 1.2
6 2019/08/12 18:04:57 jsing
Exp $ */
+/* $OpenBSD: cms_pwri.c,v 1.2
7 2022/01/19 13:47:44 inoguchi
Exp $ */
/*
* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project.
@@
-126,7
+126,9
@@
CMS_add0_recipient_password(CMS_ContentInfo *cms, int iter, int wrap_nid,
if (encalg == NULL) {
goto merr;
}
- ctx = EVP_CIPHER_CTX_new();
+
+ if ((ctx = EVP_CIPHER_CTX_new()) == NULL)
+ goto merr;
if (EVP_EncryptInit_ex(ctx, kekciph, NULL, NULL, NULL) <= 0) {
CMSerror(ERR_R_EVP_LIB);