summaryrefslogtreecommitdiffstats
path: root/crypto/asn1/tasn_dec.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2009-03-25 12:53:50 +0000
committerDr. Stephen Henson <steve@openssl.org>2009-03-25 12:53:50 +0000
commit80b2ff978d4f309cea71754ae6bcc01d6b36ea20 (patch)
tree300bb42ec133747cad21c09a1ab60a2a451cccaf /crypto/asn1/tasn_dec.c
parent7ce8c95d58ded63f9b5d40d98d9329b2cc751827 (diff)
Update from stable branch.
Diffstat (limited to 'crypto/asn1/tasn_dec.c')
-rw-r--r--crypto/asn1/tasn_dec.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/crypto/asn1/tasn_dec.c b/crypto/asn1/tasn_dec.c
index b8fa20896b..359e9c304b 100644
--- a/crypto/asn1/tasn_dec.c
+++ b/crypto/asn1/tasn_dec.c
@@ -1016,6 +1016,18 @@ int asn1_ex_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len,
case V_ASN1_SET:
case V_ASN1_SEQUENCE:
default:
+ if (utype == V_ASN1_BMPSTRING && (len & 1))
+ {
+ ASN1err(ASN1_F_ASN1_EX_C2I,
+ ASN1_R_BMPSTRING_IS_WRONG_LENGTH);
+ goto err;
+ }
+ if (utype == V_ASN1_UNIVERSALSTRING && (len & 3))
+ {
+ ASN1err(ASN1_F_ASN1_EX_C2I,
+ ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH);
+ goto err;
+ }
/* All based on ASN1_STRING and handled the same */
if (!*pval)
{