crypto/asn1/asn1_gen.c:167: error: UNINITIALIZED_VALUE
  The value read from asn1_tags.utype was never initialized.
Showing all 1 steps of the trace


crypto/asn1/asn1_gen.c:167:15: 
165.           ret = asn1_multi(asn1_tags.utype, asn1_tags.str, cnf);
166.       } else
167. >         ret = asn1_str2type(asn1_tags.str, asn1_tags.format, asn1_tags.utype);
168.   
169.       if (!ret)

ASN1_TYPE *ASN1_generate_v3(char *str, X509V3_CTX *cnf)
{
    ASN1_TYPE *ret;
    tag_exp_arg asn1_tags;
    tag_exp_type *etmp;
    int i, len;
    unsigned char *orig_der = NULL, *new_der = NULL;
    const unsigned char *cpy_start;
    unsigned char *p;
    const unsigned char *cp;
    int cpy_len;
    long hdr_len;
    int hdr_constructed = 0, hdr_tag, hdr_class;
    int r;
    asn1_tags.imp_tag = -1;
    asn1_tags.imp_class = -1;
    asn1_tags.format = ASN1_GEN_FORMAT_ASCII;
    asn1_tags.exp_count = 0;
    if (CONF_parse_list(str, ',', 1, asn1_cb, &asn1_tags) != 0)
        return NULL;
    if ((asn1_tags.utype == V_ASN1_SEQUENCE)
        || (asn1_tags.utype == V_ASN1_SET)) {
        if (!cnf) {
            ASN1err(ASN1_F_ASN1_GENERATE_V3,
                    ASN1_R_SEQUENCE_OR_SET_NEEDS_CONFIG);
            return NULL;
        }
        ret = asn1_multi(asn1_tags.utype, asn1_tags.str, cnf);
    } else
        ret = asn1_str2type(asn1_tags.str, asn1_tags.format, asn1_tags.utype);
    if (!ret)
        return NULL;
    if ((asn1_tags.imp_tag == -1) && (asn1_tags.exp_count == 0))
        return ret;
    cpy_len = i2d_ASN1_TYPE(ret, &orig_der);
    ASN1_TYPE_free(ret);
    ret = NULL;
    cpy_start = orig_der;
    if (asn1_tags.imp_tag != -1) {
        r = ASN1_get_object(&cpy_start, &hdr_len, &hdr_tag, &hdr_class,
                            cpy_len);
        if (r & 0x80)
            goto err;
        cpy_len -= cpy_start - orig_der;
        if (r & 0x1) {
            hdr_constructed = 2;
            hdr_len = 0;
        } else
            hdr_constructed = r & V_ASN1_CONSTRUCTED;
        len = ASN1_object_size(0, hdr_len, asn1_tags.imp_tag);
    } else
        len = cpy_len;
    for (i = 0, etmp = asn1_tags.exp_list + asn1_tags.exp_count - 1;
         i < asn1_tags.exp_count; i++, etmp--) {
        len += etmp->exp_pad;
        etmp->exp_len = len;
        len = ASN1_object_size(0, len, etmp->exp_tag);
    }
    new_der = OPENSSL_malloc(len);
    if (!new_der)
        goto err;
    p = new_der;
    for (i = 0, etmp = asn1_tags.exp_list; i < asn1_tags.exp_count;
         i++, etmp++) {
        ASN1_put_object(&p, etmp->exp_constructed, etmp->exp_len,
                        etmp->exp_tag, etmp->exp_class);
        if (etmp->exp_pad)
            *p++ = 0;
    }
    if (asn1_tags.imp_tag != -1) {
        if (asn1_tags.imp_class == V_ASN1_UNIVERSAL
            && (asn1_tags.imp_tag == V_ASN1_SEQUENCE
                || asn1_tags.imp_tag == V_ASN1_SET))
            hdr_constructed = V_ASN1_CONSTRUCTED;
        ASN1_put_object(&p, hdr_constructed, hdr_len,
                        asn1_tags.imp_tag, asn1_tags.imp_class);
    }
    memcpy(p, cpy_start, cpy_len);
    cp = new_der;
    ret = d2i_ASN1_TYPE(NULL, &cp, len);
 err:
    if (orig_der)
        OPENSSL_free(orig_der);
    if (new_der)
        OPENSSL_free(new_der);
    return ret;
}
["ASN1_TYPE *ASN1_generate_v3(char *str, X509V3_CTX *cnf)\n{\n    ASN1_TYPE *ret;\n    tag_exp_arg asn1_tags;\n    tag_exp_type *etmp;\n    int i, len;\n    unsigned char *orig_der = NULL, *new_der = NULL;\n    const unsigned char *cpy_start;\n    unsigned char *p;\n    const unsigned char *cp;\n    int cpy_len;\n    long hdr_len;\n    int hdr_constructed = 0, hdr_tag, hdr_class;\n    int r;\n    asn1_tags.imp_tag = -1;\n    asn1_tags.imp_class = -1;\n    asn1_tags.format = ASN1_GEN_FORMAT_ASCII;\n    asn1_tags.exp_count = 0;\n    if (CONF_parse_list(str, ',', 1, asn1_cb, &asn1_tags) != 0)\n        return NULL;\n    if ((asn1_tags.utype == V_ASN1_SEQUENCE)\n        || (asn1_tags.utype == V_ASN1_SET)) {\n        if (!cnf) {\n            ASN1err(ASN1_F_ASN1_GENERATE_V3,\n                    ASN1_R_SEQUENCE_OR_SET_NEEDS_CONFIG);\n            return NULL;\n        }\n        ret = asn1_multi(asn1_tags.utype, asn1_tags.str, cnf);\n    } else\n        ret = asn1_str2type(asn1_tags.str, asn1_tags.format, asn1_tags.utype);\n    if (!ret)\n        return NULL;\n    if ((asn1_tags.imp_tag == -1) && (asn1_tags.exp_count == 0))\n        return ret;\n    cpy_len = i2d_ASN1_TYPE(ret, &orig_der);\n    ASN1_TYPE_free(ret);\n    ret = NULL;\n    cpy_start = orig_der;\n    if (asn1_tags.imp_tag != -1) {\n        r = ASN1_get_object(&cpy_start, &hdr_len, &hdr_tag, &hdr_class,\n                            cpy_len);\n        if (r & 0x80)\n            goto err;\n        cpy_len -= cpy_start - orig_der;\n        if (r & 0x1) {\n            hdr_constructed = 2;\n            hdr_len = 0;\n        } else\n            hdr_constructed = r & V_ASN1_CONSTRUCTED;\n        len = ASN1_object_size(0, hdr_len, asn1_tags.imp_tag);\n    } else\n        len = cpy_len;\n    for (i = 0, etmp = asn1_tags.exp_list + asn1_tags.exp_count - 1;\n         i < asn1_tags.exp_count; i++, etmp--) {\n        len += etmp->exp_pad;\n        etmp->exp_len = len;\n        len = ASN1_object_size(0, len, etmp->exp_tag);\n    }\n    new_der = OPENSSL_malloc(len);\n    if (!new_der)\n        goto err;\n    p = new_der;\n    for (i = 0, etmp = asn1_tags.exp_list; i < asn1_tags.exp_count;\n         i++, etmp++) {\n        ASN1_put_object(&p, etmp->exp_constructed, etmp->exp_len,\n                        etmp->exp_tag, etmp->exp_class);\n        if (etmp->exp_pad)\n            *p++ = 0;\n    }\n    if (asn1_tags.imp_tag != -1) {\n        if (asn1_tags.imp_class == V_ASN1_UNIVERSAL\n            && (asn1_tags.imp_tag == V_ASN1_SEQUENCE\n                || asn1_tags.imp_tag == V_ASN1_SET))\n            hdr_constructed = V_ASN1_CONSTRUCTED;\n        ASN1_put_object(&p, hdr_constructed, hdr_len,\n                        asn1_tags.imp_tag, asn1_tags.imp_class);\n    }\n    memcpy(p, cpy_start, cpy_len);\n    cp = new_der;\n    ret = d2i_ASN1_TYPE(NULL, &cp, len);\n err:\n    if (orig_der)\n        OPENSSL_free(orig_der);\n    if (new_der)\n        OPENSSL_free(new_der);\n    return ret;\n}"]