diff options
author | Dr. Stephen Henson <steve@openssl.org> | 1999-12-10 13:46:48 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 1999-12-10 13:46:48 +0000 |
commit | d8223efd04f8526b602209ee5f39c06fa300beea (patch) | |
tree | 7044ee8ece86c78beda2c8480d189714410c2d5e /crypto/asn1/a_enum.c | |
parent | e3775a33c1ee5aa845527c3fd9aac11426eac8c5 (diff) |
Fix for crashing INTEGERs, ENUMERATEDs and OBJECT IDENTIFIERs.
Also fix a memory leak in PKCS#7 routines.
Diffstat (limited to 'crypto/asn1/a_enum.c')
-rw-r--r-- | crypto/asn1/a_enum.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/crypto/asn1/a_enum.c b/crypto/asn1/a_enum.c index 61349ed003..38134f3688 100644 --- a/crypto/asn1/a_enum.c +++ b/crypto/asn1/a_enum.c @@ -177,7 +177,12 @@ ASN1_ENUMERATED *d2i_ASN1_ENUMERATED(ASN1_ENUMERATED **a, unsigned char **pp, goto err; } to=s; - if (*p & 0x80) /* a negative number */ + if(!len) { + /* Strictly speaking this is an illegal ENUMERATED but we + * tolerate it. + */ + ret->type=V_ASN1_INTEGER; + } else if (*p & 0x80) /* a negative number */ { ret->type=V_ASN1_NEG_ENUMERATED; if ((*p == 0xff) && (len != 1)) { |