projects
/
oweals
/
openssl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fb7fbf2
)
get_cert_by_subject: check for NULL when allocating hent
author
Jonas Maebe
<jonas.maebe@elis.ugent.be>
Sun, 8 Dec 2013 21:45:58 +0000
(22:45 +0100)
committer
Kurt Roeckx
<kurt@roeckx.be>
Sun, 17 Aug 2014 16:55:01 +0000
(18:55 +0200)
Signed-off-by: Kurt Roeckx <kurt@openssl.org>
Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
crypto/x509/by_dir.c
patch
|
blob
|
history
diff --git
a/crypto/x509/by_dir.c
b/crypto/x509/by_dir.c
index c6602dae4f58b88416a6d2cdbcbb4ab7d0868eaf..8f3560a232382e996dedd60709bcc885ca98ccd4 100644
(file)
--- a/
crypto/x509/by_dir.c
+++ b/
crypto/x509/by_dir.c
@@
-444,6
+444,13
@@
static int get_cert_by_subject(X509_LOOKUP *xl, int type, X509_NAME *name,
if (!hent)
{
hent = OPENSSL_malloc(sizeof(BY_DIR_HASH));
+ if (hent == NULL)
+ {
+ CRYPTO_w_unlock(CRYPTO_LOCK_X509_STORE);
+ X509err(X509_F_GET_CERT_BY_SUBJECT,ERR_R_MALLOC_FAILURE);
+ ok = 0;
+ goto finish;
+ }
hent->hash = h;
hent->suffix = k;
if (!sk_BY_DIR_HASH_push(ent->hashes, hent))