summaryrefslogtreecommitdiffstats
path: root/crypto/asn1/evp_asn1.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2004-12-05 01:03:15 +0000
committerDr. Stephen Henson <steve@openssl.org>2004-12-05 01:03:15 +0000
commita0e7c8eede26b29b09057f48b8e51f46f8811ddd (patch)
tree2b50575b4e9e608b61cb74246915625bd99b85d8 /crypto/asn1/evp_asn1.c
parenta8e00b17ce840c58787e45411fa2ac4d6b1fb10c (diff)
Add lots of checks for memory allocation failure, error codes to indicate
failure and freeing up memory if a failure occurs. PR:620
Diffstat (limited to 'crypto/asn1/evp_asn1.c')
-rw-r--r--crypto/asn1/evp_asn1.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/crypto/asn1/evp_asn1.c b/crypto/asn1/evp_asn1.c
index 162b37bc38..f3d9804860 100644
--- a/crypto/asn1/evp_asn1.c
+++ b/crypto/asn1/evp_asn1.c
@@ -115,7 +115,11 @@ int ASN1_TYPE_set_int_octetstring(ASN1_TYPE *a, long num, unsigned char *data,
if ((osp=ASN1_STRING_new()) == NULL) return(0);
/* Grow the 'string' */
- ASN1_STRING_set(osp,NULL,size);
+ if (!ASN1_STRING_set(osp,NULL,size))
+ {
+ ASN1_STRING_free(osp);
+ return(0);
+ }
M_ASN1_STRING_length_set(osp, size);
p=M_ASN1_STRING_data(osp);