crypto/asn1/tasn_dec.c:642: error: UNINITIALIZED_VALUE
  The value read from buf.data was never initialized.
Showing all 1 steps of the trace


crypto/asn1/tasn_dec.c:642:18: 
640.   	ret = 1;
641.   	err:
642. > 	if(free_cont && buf.data) OPENSSL_free(buf.data);
643.   	return ret;
644.   }

static int asn1_d2i_ex_primitive(ASN1_VALUE **pval, unsigned char **in, long inlen,
						const ASN1_ITEM *it,
						int tag, int aclass, char opt, ASN1_TLC *ctx)
{
	int ret = 0, utype;
	long plen;
	char cst, inf, free_cont = 0;
	unsigned char *p;
	BUF_MEM buf;
	unsigned char *cont = NULL;
	long len;
	if(!pval) {
		ASN1err(ASN1_F_ASN1_D2I_EX_PRIMITIVE, ASN1_R_ILLEGAL_NULL);
		return 0;
	}
	if(it->itype == ASN1_ITYPE_MSTRING) {
		utype = tag;
		tag = -1;
	} else utype = it->utype;
	if(utype == V_ASN1_ANY) {
		unsigned char oclass;
		if(tag >= 0) {
			ASN1err(ASN1_F_ASN1_D2I_EX_PRIMITIVE, ASN1_R_ILLEGAL_TAGGED_ANY);
			return 0;
		}
		if(opt) {
			ASN1err(ASN1_F_ASN1_D2I_EX_PRIMITIVE, ASN1_R_ILLEGAL_OPTIONAL_ANY);
			return 0;
		}
		p = *in;
		ret = asn1_check_tlen(NULL, &utype, &oclass, NULL, NULL, &p, inlen, -1, 0, 0, ctx);
		if(!ret) {
			ASN1err(ASN1_F_ASN1_D2I_EX_PRIMITIVE, ERR_R_NESTED_ASN1_ERROR);
			return 0;
		}
		if(oclass != V_ASN1_UNIVERSAL) utype = V_ASN1_OTHER;
	}
	if(tag == -1) {
		tag = utype;
		aclass = V_ASN1_UNIVERSAL;
	}
	p = *in;
	ret = asn1_check_tlen(&plen, NULL, NULL, &inf, &cst, &p, inlen, tag, aclass, opt, ctx);
	if(!ret) {
		ASN1err(ASN1_F_ASN1_D2I_EX_PRIMITIVE, ERR_R_NESTED_ASN1_ERROR);
		return 0;
	} else if(ret == -1) return -1;
	if((utype == V_ASN1_SEQUENCE) || (utype == V_ASN1_SET) || (utype == V_ASN1_OTHER)) {
		if((utype != V_ASN1_OTHER) && !cst) {
			ASN1err(ASN1_F_ASN1_D2I_EX_PRIMITIVE, ASN1_R_TYPE_NOT_CONSTRUCTED);
			return 0;
		}
		cont = *in;
		if(inf) {
			asn1_collect(NULL, &p, plen, inf, -1, -1);
			len = p - cont;
		} else {
			len = p - cont + plen;
			p += plen;
			buf.data = NULL;
		}
	} else if(cst) {
		buf.length = 0;
		buf.max = 0;
		buf.data = NULL;
		asn1_collect(&buf, &p, plen, inf, -1, V_ASN1_UNIVERSAL);
		cont = (unsigned char *)buf.data;
		len = buf.length;
		free_cont = 1;
	} else {
		cont = p;
		len = plen;
		p += plen;
	}
	if(!asn1_ex_c2i(pval, cont, len, utype, &free_cont, it)) goto err;
	*in = p;
	ret = 1;
	err:
	if(free_cont && buf.data) OPENSSL_free(buf.data);
	return ret;
}
['static int asn1_d2i_ex_primitive(ASN1_VALUE **pval, unsigned char **in, long inlen,\n\t\t\t\t\t\tconst ASN1_ITEM *it,\n\t\t\t\t\t\tint tag, int aclass, char opt, ASN1_TLC *ctx)\n{\n\tint ret = 0, utype;\n\tlong plen;\n\tchar cst, inf, free_cont = 0;\n\tunsigned char *p;\n\tBUF_MEM buf;\n\tunsigned char *cont = NULL;\n\tlong len;\n\tif(!pval) {\n\t\tASN1err(ASN1_F_ASN1_D2I_EX_PRIMITIVE, ASN1_R_ILLEGAL_NULL);\n\t\treturn 0;\n\t}\n\tif(it->itype == ASN1_ITYPE_MSTRING) {\n\t\tutype = tag;\n\t\ttag = -1;\n\t} else utype = it->utype;\n\tif(utype == V_ASN1_ANY) {\n\t\tunsigned char oclass;\n\t\tif(tag >= 0) {\n\t\t\tASN1err(ASN1_F_ASN1_D2I_EX_PRIMITIVE, ASN1_R_ILLEGAL_TAGGED_ANY);\n\t\t\treturn 0;\n\t\t}\n\t\tif(opt) {\n\t\t\tASN1err(ASN1_F_ASN1_D2I_EX_PRIMITIVE, ASN1_R_ILLEGAL_OPTIONAL_ANY);\n\t\t\treturn 0;\n\t\t}\n\t\tp = *in;\n\t\tret = asn1_check_tlen(NULL, &utype, &oclass, NULL, NULL, &p, inlen, -1, 0, 0, ctx);\n\t\tif(!ret) {\n\t\t\tASN1err(ASN1_F_ASN1_D2I_EX_PRIMITIVE, ERR_R_NESTED_ASN1_ERROR);\n\t\t\treturn 0;\n\t\t}\n\t\tif(oclass != V_ASN1_UNIVERSAL) utype = V_ASN1_OTHER;\n\t}\n\tif(tag == -1) {\n\t\ttag = utype;\n\t\taclass = V_ASN1_UNIVERSAL;\n\t}\n\tp = *in;\n\tret = asn1_check_tlen(&plen, NULL, NULL, &inf, &cst, &p, inlen, tag, aclass, opt, ctx);\n\tif(!ret) {\n\t\tASN1err(ASN1_F_ASN1_D2I_EX_PRIMITIVE, ERR_R_NESTED_ASN1_ERROR);\n\t\treturn 0;\n\t} else if(ret == -1) return -1;\n\tif((utype == V_ASN1_SEQUENCE) || (utype == V_ASN1_SET) || (utype == V_ASN1_OTHER)) {\n\t\tif((utype != V_ASN1_OTHER) && !cst) {\n\t\t\tASN1err(ASN1_F_ASN1_D2I_EX_PRIMITIVE, ASN1_R_TYPE_NOT_CONSTRUCTED);\n\t\t\treturn 0;\n\t\t}\n\t\tcont = *in;\n\t\tif(inf) {\n\t\t\tasn1_collect(NULL, &p, plen, inf, -1, -1);\n\t\t\tlen = p - cont;\n\t\t} else {\n\t\t\tlen = p - cont + plen;\n\t\t\tp += plen;\n\t\t\tbuf.data = NULL;\n\t\t}\n\t} else if(cst) {\n\t\tbuf.length = 0;\n\t\tbuf.max = 0;\n\t\tbuf.data = NULL;\n\t\tasn1_collect(&buf, &p, plen, inf, -1, V_ASN1_UNIVERSAL);\n\t\tcont = (unsigned char *)buf.data;\n\t\tlen = buf.length;\n\t\tfree_cont = 1;\n\t} else {\n\t\tcont = p;\n\t\tlen = plen;\n\t\tp += plen;\n\t}\n\tif(!asn1_ex_c2i(pval, cont, len, utype, &free_cont, it)) goto err;\n\t*in = p;\n\tret = 1;\n\terr:\n\tif(free_cont && buf.data) OPENSSL_free(buf.data);\n\treturn ret;\n}']