apps/pkcs12.c:772: error: NULL_DEREFERENCE
  pointer `av` last assigned on line 771 could be null and is dereferenced at line 772, column 11.
Showing all 50 steps of the trace


apps/pkcs12.c:746:1: start of procedure print_attribs()
744.   /* Generalised attribute print: handle PKCS#8 and bag attributes */
745.   
746. > int print_attribs (BIO *out, STACK_OF(X509_ATTRIBUTE) *attrlst, char *name)
747.   {
748.   	X509_ATTRIBUTE *attr;

apps/pkcs12.c:752:6: Taking false branch
750.   	char *value;
751.   	int i, attr_nid;
752.   	if(!attrlst) {
            ^
753.   		BIO_printf(out, "%s: <No Attributes>\n", name);
754.   		return 1;

apps/pkcs12.c:756:6: 
754.   		return 1;
755.   	}
756. > 	if(!sk_X509_ATTRIBUTE_num(attrlst)) {
757.   		BIO_printf(out, "%s: <Empty Attributes>\n", name);
758.   		return 1;

crypto/stack/stack.c:294:1: start of procedure sk_num()
  292.   	}
  293.   
  294. > int sk_num(const STACK *st)
  295.   {
  296.   	if(st == NULL) return -1;

crypto/stack/stack.c:296:5: Taking false branch
  294.   int sk_num(const STACK *st)
  295.   {
  296.   	if(st == NULL) return -1;
             ^
  297.   	return st->num;
  298.   }

crypto/stack/stack.c:297:2: 
  295.   {
  296.   	if(st == NULL) return -1;
  297. > 	return st->num;
  298.   }
  299.   

crypto/stack/stack.c:298:1: return from a call to sk_num
  296.   	if(st == NULL) return -1;
  297.   	return st->num;
  298. > }
  299.   
  300.   char *sk_value(const STACK *st, int i)

apps/pkcs12.c:756:6: Taking false branch
754.   		return 1;
755.   	}
756.   	if(!sk_X509_ATTRIBUTE_num(attrlst)) {
            ^
757.   		BIO_printf(out, "%s: <Empty Attributes>\n", name);
758.   		return 1;

apps/pkcs12.c:760:2: Skipping BIO_printf(): empty list of specs
758.   		return 1;
759.   	}
760.   	BIO_printf(out, "%s\n", name);
        ^
761.   	for(i = 0; i < sk_X509_ATTRIBUTE_num(attrlst); i++) {
762.   		attr = sk_X509_ATTRIBUTE_value(attrlst, i);

apps/pkcs12.c:761:6: 
759.   	}
760.   	BIO_printf(out, "%s\n", name);
761. > 	for(i = 0; i < sk_X509_ATTRIBUTE_num(attrlst); i++) {
762.   		attr = sk_X509_ATTRIBUTE_value(attrlst, i);
763.   		attr_nid = OBJ_obj2nid(attr->object);

apps/pkcs12.c:761:13: 
759.   	}
760.   	BIO_printf(out, "%s\n", name);
761. > 	for(i = 0; i < sk_X509_ATTRIBUTE_num(attrlst); i++) {
762.   		attr = sk_X509_ATTRIBUTE_value(attrlst, i);
763.   		attr_nid = OBJ_obj2nid(attr->object);

crypto/stack/stack.c:294:1: start of procedure sk_num()
  292.   	}
  293.   
  294. > int sk_num(const STACK *st)
  295.   {
  296.   	if(st == NULL) return -1;

crypto/stack/stack.c:296:5: Taking false branch
  294.   int sk_num(const STACK *st)
  295.   {
  296.   	if(st == NULL) return -1;
             ^
  297.   	return st->num;
  298.   }

crypto/stack/stack.c:297:2: 
  295.   {
  296.   	if(st == NULL) return -1;
  297. > 	return st->num;
  298.   }
  299.   

crypto/stack/stack.c:298:1: return from a call to sk_num
  296.   	if(st == NULL) return -1;
  297.   	return st->num;
  298. > }
  299.   
  300.   char *sk_value(const STACK *st, int i)

apps/pkcs12.c:761:13: Loop condition is true. Entering loop body
759.   	}
760.   	BIO_printf(out, "%s\n", name);
761.   	for(i = 0; i < sk_X509_ATTRIBUTE_num(attrlst); i++) {
                   ^
762.   		attr = sk_X509_ATTRIBUTE_value(attrlst, i);
763.   		attr_nid = OBJ_obj2nid(attr->object);

apps/pkcs12.c:762:3: 
760.   	BIO_printf(out, "%s\n", name);
761.   	for(i = 0; i < sk_X509_ATTRIBUTE_num(attrlst); i++) {
762. > 		attr = sk_X509_ATTRIBUTE_value(attrlst, i);
763.   		attr_nid = OBJ_obj2nid(attr->object);
764.   		BIO_printf(out, "    ");

crypto/stack/stack.c:300:1: start of procedure sk_value()
  298.   }
  299.   
  300. > char *sk_value(const STACK *st, int i)
  301.   {
  302.   	if(st == NULL) return NULL;

crypto/stack/stack.c:302:5: Taking false branch
  300.   char *sk_value(const STACK *st, int i)
  301.   {
  302.   	if(st == NULL) return NULL;
             ^
  303.   	return st->data[i];
  304.   }

crypto/stack/stack.c:303:2: 
  301.   {
  302.   	if(st == NULL) return NULL;
  303. > 	return st->data[i];
  304.   }
  305.   

crypto/stack/stack.c:304:1: return from a call to sk_value
  302.   	if(st == NULL) return NULL;
  303.   	return st->data[i];
  304. > }
  305.   
  306.   char *sk_set(STACK *st, int i, char *value)

apps/pkcs12.c:763:3: 
761.   	for(i = 0; i < sk_X509_ATTRIBUTE_num(attrlst); i++) {
762.   		attr = sk_X509_ATTRIBUTE_value(attrlst, i);
763. > 		attr_nid = OBJ_obj2nid(attr->object);
764.   		BIO_printf(out, "    ");
765.   		if(attr_nid == NID_undef) {

crypto/objects/obj_dat.c:350:1: start of procedure OBJ_obj2nid()
  348.   	}
  349.   
  350. > int OBJ_obj2nid(ASN1_OBJECT *a)
  351.   	{
  352.   	ASN1_OBJECT **op;

crypto/objects/obj_dat.c:355:6: Taking false branch
  353.   	ADDED_OBJ ad,*adp;
  354.   
  355.   	if (a == NULL)
              ^
  356.   		return(NID_undef);
  357.   	if (a->nid != 0)

crypto/objects/obj_dat.c:357:6: Taking true branch
  355.   	if (a == NULL)
  356.   		return(NID_undef);
  357.   	if (a->nid != 0)
              ^
  358.   		return(a->nid);
  359.   

crypto/objects/obj_dat.c:358:3: 
  356.   		return(NID_undef);
  357.   	if (a->nid != 0)
  358. > 		return(a->nid);
  359.   
  360.   	if (added != NULL)

crypto/objects/obj_dat.c:372:2: return from a call to OBJ_obj2nid
  370.   		return(NID_undef);
  371.   	return((*op)->nid);
  372.   	}
          ^
  373.   
  374.   /* Convert an object name into an ASN1_OBJECT

apps/pkcs12.c:764:3: Skipping BIO_printf(): empty list of specs
762.   		attr = sk_X509_ATTRIBUTE_value(attrlst, i);
763.   		attr_nid = OBJ_obj2nid(attr->object);
764.   		BIO_printf(out, "    ");
         ^
765.   		if(attr_nid == NID_undef) {
766.   			i2a_ASN1_OBJECT (out, attr->object);

apps/pkcs12.c:765:6: Taking false branch
763.   		attr_nid = OBJ_obj2nid(attr->object);
764.   		BIO_printf(out, "    ");
765.   		if(attr_nid == NID_undef) {
            ^
766.   			i2a_ASN1_OBJECT (out, attr->object);
767.   			BIO_printf(out, ": ");

apps/pkcs12.c:768:10: 
766.   			i2a_ASN1_OBJECT (out, attr->object);
767.   			BIO_printf(out, ": ");
768. > 		} else BIO_printf(out, "%s: ", OBJ_nid2ln(attr_nid));
769.   
770.   		if(sk_ASN1_TYPE_num(attr->value.set)) {

crypto/objects/obj_dat.c:318:1: start of procedure OBJ_nid2ln()
  316.   	}
  317.   
  318. > const char *OBJ_nid2ln(int n)
  319.   	{
  320.   	ADDED_OBJ ad,*adp;

crypto/objects/obj_dat.c:323:7: Taking true branch
  321.   	ASN1_OBJECT ob;
  322.   
  323.   	if ((n >= 0) && (n < NUM_NID))
               ^
  324.   		{
  325.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))

crypto/objects/obj_dat.c:323:19: Taking true branch
  321.   	ASN1_OBJECT ob;
  322.   
  323.   	if ((n >= 0) && (n < NUM_NID))
                           ^
  324.   		{
  325.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))

crypto/objects/obj_dat.c:325:8: Taking true branch
  323.   	if ((n >= 0) && (n < NUM_NID))
  324.   		{
  325.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))
                ^
  326.   			{
  327.   			OBJerr(OBJ_F_OBJ_NID2LN,OBJ_R_UNKNOWN_NID);

crypto/objects/obj_dat.c:325:28: Taking false branch
  323.   	if ((n >= 0) && (n < NUM_NID))
  324.   		{
  325.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))
                                    ^
  326.   			{
  327.   			OBJerr(OBJ_F_OBJ_NID2LN,OBJ_R_UNKNOWN_NID);

crypto/objects/obj_dat.c:330:3: 
  328.   			return(NULL);
  329.   			}
  330. > 		return(nid_objs[n].ln);
  331.   		}
  332.   	else if (added == NULL)

crypto/objects/obj_dat.c:348:2: return from a call to OBJ_nid2ln
  346.   			}
  347.   		}
  348.   	}
          ^
  349.   
  350.   int OBJ_obj2nid(ASN1_OBJECT *a)

apps/pkcs12.c:768:10: Skipping BIO_printf(): empty list of specs
766.   			i2a_ASN1_OBJECT (out, attr->object);
767.   			BIO_printf(out, ": ");
768.   		} else BIO_printf(out, "%s: ", OBJ_nid2ln(attr_nid));
                ^
769.   
770.   		if(sk_ASN1_TYPE_num(attr->value.set)) {

apps/pkcs12.c:770:6: 
768.   		} else BIO_printf(out, "%s: ", OBJ_nid2ln(attr_nid));
769.   
770. > 		if(sk_ASN1_TYPE_num(attr->value.set)) {
771.   			av = sk_ASN1_TYPE_value(attr->value.set, 0);
772.   			switch(av->type) {

crypto/stack/stack.c:294:1: start of procedure sk_num()
  292.   	}
  293.   
  294. > int sk_num(const STACK *st)
  295.   {
  296.   	if(st == NULL) return -1;

crypto/stack/stack.c:296:5: Taking true branch
  294.   int sk_num(const STACK *st)
  295.   {
  296.   	if(st == NULL) return -1;
             ^
  297.   	return st->num;
  298.   }

crypto/stack/stack.c:296:17: 
  294.   int sk_num(const STACK *st)
  295.   {
  296. > 	if(st == NULL) return -1;
  297.   	return st->num;
  298.   }

crypto/stack/stack.c:298:1: return from a call to sk_num
  296.   	if(st == NULL) return -1;
  297.   	return st->num;
  298. > }
  299.   
  300.   char *sk_value(const STACK *st, int i)

apps/pkcs12.c:770:6: Taking true branch
768.   		} else BIO_printf(out, "%s: ", OBJ_nid2ln(attr_nid));
769.   
770.   		if(sk_ASN1_TYPE_num(attr->value.set)) {
            ^
771.   			av = sk_ASN1_TYPE_value(attr->value.set, 0);
772.   			switch(av->type) {

apps/pkcs12.c:771:4: 
769.   
770.   		if(sk_ASN1_TYPE_num(attr->value.set)) {
771. > 			av = sk_ASN1_TYPE_value(attr->value.set, 0);
772.   			switch(av->type) {
773.   				case V_ASN1_BMPSTRING:

crypto/stack/stack.c:300:1: start of procedure sk_value()
  298.   }
  299.   
  300. > char *sk_value(const STACK *st, int i)
  301.   {
  302.   	if(st == NULL) return NULL;

crypto/stack/stack.c:302:5: Taking true branch
  300.   char *sk_value(const STACK *st, int i)
  301.   {
  302.   	if(st == NULL) return NULL;
             ^
  303.   	return st->data[i];
  304.   }

crypto/stack/stack.c:302:17: 
  300.   char *sk_value(const STACK *st, int i)
  301.   {
  302. > 	if(st == NULL) return NULL;
  303.   	return st->data[i];
  304.   }

crypto/stack/stack.c:304:1: return from a call to sk_value
  302.   	if(st == NULL) return NULL;
  303.   	return st->data[i];
  304. > }
  305.   
  306.   char *sk_set(STACK *st, int i, char *value)

apps/pkcs12.c:772:4: 
770.   		if(sk_ASN1_TYPE_num(attr->value.set)) {
771.   			av = sk_ASN1_TYPE_value(attr->value.set, 0);
772. > 			switch(av->type) {
773.   				case V_ASN1_BMPSTRING:
774.           			value = uni2asc(av->value.bmpstring->data,
