Avoid possible memory leaks in error-handling.
[oweals/openssl.git] / crypto / asn1 / asn1_gen.c
index 3d9d2ce07b9940f0fcb1cc05123ac6140932ca08..277726cd504946b7ac0416738a86ef95e021179c 100644 (file)
@@ -544,7 +544,7 @@ static int append_exp(tag_exp_arg *arg, int exp_tag, int exp_class, int exp_cons
 
 static int asn1_str2tag(const char *tagstr, int len)
        {
-       int i;
+       unsigned int i;
        static struct tag_name_st *tntmp, tnst [] = {
                ASN1_GEN_STR("BOOL", V_ASN1_BOOLEAN),
                ASN1_GEN_STR("BOOLEAN", V_ASN1_BOOLEAN),
@@ -597,7 +597,7 @@ static int asn1_str2tag(const char *tagstr, int len)
                /* SEQUENCE wrapper */
                ASN1_GEN_STR("SEQWRAP", ASN1_GEN_FLAG_SEQWRAP),
                /* SET wrapper */
-               ASN1_GEN_STR("SETWRAP", ASN1_GEN_FLAG_SEQWRAP),
+               ASN1_GEN_STR("SETWRAP", ASN1_GEN_FLAG_SETWRAP),
                /* BIT STRING wrapper */
                ASN1_GEN_STR("BITWRAP", ASN1_GEN_FLAG_BITWRAP),
                ASN1_GEN_STR("FORM", ASN1_GEN_FLAG_FORMAT),
@@ -722,6 +722,7 @@ static ASN1_TYPE *asn1_str2type(const char *str, int format, int utype)
                case V_ASN1_UTF8STRING:
                case V_ASN1_VISIBLESTRING:
                case V_ASN1_UNIVERSALSTRING:
+               case V_ASN1_GENERALSTRING:
 
                if (format == ASN1_GEN_FORMAT_ASCII)
                        format = MBSTRING_ASC;