crypto/asn1/tasn_enc.c:326: error: UNINITIALIZED_VALUE
  The value read from derlst was never initialized.
Showing all 1 steps of the trace


crypto/asn1/tasn_enc.c:326:13: 
324.   	p = tmpdat;
325.   	/* Doing sort: build up a list of each member's DER encoding */
326. > 	for(i = 0, tder = derlst; i < sk_ASN1_VALUE_num(sk); i++, tder++) {
327.   		skitem = sk_ASN1_VALUE_value(sk, i);
328.   		tder->data = p;

static int asn1_set_seq_out(STACK_OF(ASN1_VALUE) *sk, unsigned char **out, int skcontlen, const ASN1_ITEM *item, int do_sort)
{
	int i;
	ASN1_VALUE *skitem;
	unsigned char *tmpdat, *p;
	DER_ENC *derlst, *tder;
	if(do_sort) {
		if(sk_ASN1_VALUE_num(sk) < 2) do_sort = 0;
		else {
			derlst = OPENSSL_malloc(sk_ASN1_VALUE_num(sk) * sizeof(*derlst));
			tmpdat = OPENSSL_malloc(skcontlen);
			if(!derlst || !tmpdat) return 0;
		}
	}
	if(!do_sort) {
		for(i = 0; i < sk_ASN1_VALUE_num(sk); i++) {
			skitem = sk_ASN1_VALUE_value(sk, i);
			ASN1_item_i2d(skitem, out, item);
		}
		return 1;
	}
	p = tmpdat;
	for(i = 0, tder = derlst; i < sk_ASN1_VALUE_num(sk); i++, tder++) {
		skitem = sk_ASN1_VALUE_value(sk, i);
		tder->data = p;
		tder->length = ASN1_item_i2d(skitem, &p, item);
	}
	qsort(derlst, sk_ASN1_VALUE_num(sk), sizeof(*derlst), der_cmp);
	p = *out;
	for(i = 0, tder = derlst; i < sk_ASN1_VALUE_num(sk); i++, tder++) {
		memcpy(p, tder->data, tder->length);
		p += tder->length;
	}
	*out = p;
	OPENSSL_free(derlst);
	OPENSSL_free(tmpdat);
	return 1;
}
['static int asn1_set_seq_out(STACK_OF(ASN1_VALUE) *sk, unsigned char **out, int skcontlen, const ASN1_ITEM *item, int do_sort)\n{\n\tint i;\n\tASN1_VALUE *skitem;\n\tunsigned char *tmpdat, *p;\n\tDER_ENC *derlst, *tder;\n\tif(do_sort) {\n\t\tif(sk_ASN1_VALUE_num(sk) < 2) do_sort = 0;\n\t\telse {\n\t\t\tderlst = OPENSSL_malloc(sk_ASN1_VALUE_num(sk) * sizeof(*derlst));\n\t\t\ttmpdat = OPENSSL_malloc(skcontlen);\n\t\t\tif(!derlst || !tmpdat) return 0;\n\t\t}\n\t}\n\tif(!do_sort) {\n\t\tfor(i = 0; i < sk_ASN1_VALUE_num(sk); i++) {\n\t\t\tskitem = sk_ASN1_VALUE_value(sk, i);\n\t\t\tASN1_item_i2d(skitem, out, item);\n\t\t}\n\t\treturn 1;\n\t}\n\tp = tmpdat;\n\tfor(i = 0, tder = derlst; i < sk_ASN1_VALUE_num(sk); i++, tder++) {\n\t\tskitem = sk_ASN1_VALUE_value(sk, i);\n\t\ttder->data = p;\n\t\ttder->length = ASN1_item_i2d(skitem, &p, item);\n\t}\n\tqsort(derlst, sk_ASN1_VALUE_num(sk), sizeof(*derlst), der_cmp);\n\tp = *out;\n\tfor(i = 0, tder = derlst; i < sk_ASN1_VALUE_num(sk); i++, tder++) {\n\t\tmemcpy(p, tder->data, tder->length);\n\t\tp += tder->length;\n\t}\n\t*out = p;\n\tOPENSSL_free(derlst);\n\tOPENSSL_free(tmpdat);\n\treturn 1;\n}']