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:
3877b6b
)
PR: 1785
author
Dr. Stephen Henson
<steve@openssl.org>
Mon, 13 Apr 2009 11:31:22 +0000
(11:31 +0000)
committer
Dr. Stephen Henson
<steve@openssl.org>
Mon, 13 Apr 2009 11:31:22 +0000
(11:31 +0000)
Submitted by: Ger Hobbelt <ger@hobbelt.com>
Approved by: steve@openssl.org
Properly handle malloc failure.
crypto/dsa/dsa_asn1.c
patch
|
blob
|
history
diff --git
a/crypto/dsa/dsa_asn1.c
b/crypto/dsa/dsa_asn1.c
index 084bd451c6008d013dbf6e20251e24744360b960..8277a74be2def3758068b911fa268d37a6fe6e62 100644
(file)
--- a/
crypto/dsa/dsa_asn1.c
+++ b/
crypto/dsa/dsa_asn1.c
@@
-69,12
+69,15
@@
static int sig_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it,
if(operation == ASN1_OP_NEW_PRE) {
DSA_SIG *sig;
sig = OPENSSL_malloc(sizeof(DSA_SIG));
+ if (!sig)
+ {
+ DSAerr(DSA_F_SIG_CB, ERR_R_MALLOC_FAILURE);
+ return 0;
+ }
sig->r = NULL;
sig->s = NULL;
*pval = (ASN1_VALUE *)sig;
- if(sig) return 2;
- DSAerr(DSA_F_SIG_CB, ERR_R_MALLOC_FAILURE);
- return 0;
+ return 2;
}
return 1;
}