[pkg-opensc-commit] [libp11] 62/86: Memory allocation failure check

Eric Dorland eric at moszumanska.debian.org
Sun Jul 24 21:40:23 UTC 2016


This is an automated email from the git hooks/post-receive script.

eric pushed a commit to branch master
in repository libp11.

commit 5aa703d78a629aa651110fccfb34e214f64ead03
Author: Michał Trojnara <Michal.Trojnara at stunnel.org>
Date:   Wed Mar 9 21:58:55 2016 +0100

    Memory allocation failure check
---
 src/p11_rsa.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/p11_rsa.c b/src/p11_rsa.c
index b7dc646..5d1e710 100644
--- a/src/p11_rsa.c
+++ b/src/p11_rsa.c
@@ -376,6 +376,8 @@ RSA_METHOD *PKCS11_get_rsa_method(void)
 	if (ops == NULL) {
 		alloc_rsa_ex_index();
 		ops = OPENSSL_malloc(sizeof(RSA_METHOD));
+		if (ops == NULL)
+			return NULL;
 		memcpy(ops, RSA_get_default_method(), sizeof(RSA_METHOD));
 		ops->rsa_priv_enc = pkcs11_rsa_priv_enc_method;
 		ops->rsa_priv_dec = pkcs11_rsa_priv_dec_method;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-opensc/libp11.git



More information about the pkg-opensc-commit mailing list