summaryrefslogtreecommitdiff
path: root/crypto/asn1/a_object.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>1999-12-10 13:46:48 +0000
committerDr. Stephen Henson <steve@openssl.org>1999-12-10 13:46:48 +0000
commitd8223efd04f8526b602209ee5f39c06fa300beea (patch)
tree7044ee8ece86c78beda2c8480d189714410c2d5e /crypto/asn1/a_object.c
parente3775a33c1ee5aa845527c3fd9aac11426eac8c5 (diff)
downloadopenssl-new-d8223efd04f8526b602209ee5f39c06fa300beea.tar.gz
Fix for crashing INTEGERs, ENUMERATEDs and OBJECT IDENTIFIERs.
Also fix a memory leak in PKCS#7 routines.
Diffstat (limited to 'crypto/asn1/a_object.c')
-rw-r--r--crypto/asn1/a_object.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/asn1/a_object.c b/crypto/asn1/a_object.c
index b94b418ee8..ab69b955b5 100644
--- a/crypto/asn1/a_object.c
+++ b/crypto/asn1/a_object.c
@@ -223,7 +223,7 @@ ASN1_OBJECT *d2i_ASN1_OBJECT(ASN1_OBJECT **a, unsigned char **pp,
if ((ret->data == NULL) || (ret->length < len))
{
if (ret->data != NULL) Free((char *)ret->data);
- ret->data=(unsigned char *)Malloc((int)len);
+ ret->data=(unsigned char *)Malloc(len ? (int)len : 1);
ret->flags|=ASN1_OBJECT_FLAG_DYNAMIC_DATA;
if (ret->data == NULL)
{ i=ERR_R_MALLOC_FAILURE; goto err; }