crypto/pkcs7/pk7_doit.c:922: error: NULL_DEREFERENCE
  pointer `*sk` last assigned on line 919 could be null and is dereferenced by call to `sk_X509_ATTRIBUTE_push()` at line 922, column 3.
Showing all 17 steps of the trace


crypto/pkcs7/pk7_doit.c:912:1: start of procedure add_attribute()
910.   	}
911.   
912. > static int add_attribute(STACK_OF(X509_ATTRIBUTE) **sk, int nid, int atrtype,
913.   			 void *value)
914.   	{

crypto/pkcs7/pk7_doit.c:915:2: 
913.   			 void *value)
914.   	{
915. > 	X509_ATTRIBUTE *attr=NULL;
916.   
917.   	if (*sk == NULL)

crypto/pkcs7/pk7_doit.c:917:6: Taking true branch
915.   	X509_ATTRIBUTE *attr=NULL;
916.   
917.   	if (*sk == NULL)
            ^
918.   		{
919.   		*sk = sk_X509_ATTRIBUTE_new(NULL);

crypto/pkcs7/pk7_doit.c:919:3: 
917.   	if (*sk == NULL)
918.   		{
919. > 		*sk = sk_X509_ATTRIBUTE_new(NULL);
920.   new_attrib:
921.   		attr=X509_ATTRIBUTE_create(nid,atrtype,value);

crypto/x509/x509_vfy.c:656:1: start of procedure sk_X509_ATTRIBUTE_new()
  654.   IMPLEMENT_STACK_OF(X509_NAME)
  655.   
  656. > IMPLEMENT_STACK_OF(X509_ATTRIBUTE)
  657.   IMPLEMENT_ASN1_SET_OF(X509_ATTRIBUTE)

crypto/stack/stack.c:112:1: start of procedure sk_new()
    110.   	}
    111.   
    112. > STACK *sk_new(int (*c)())
    113.   	{
    114.   	STACK *ret;

crypto/stack/stack.c:117:6: Taking true branch
    115.   	int i;
    116.   
    117.   	if ((ret=(STACK *)Malloc(sizeof(STACK))) == NULL)
                ^
    118.   		goto err0;
    119.   	if ((ret->data=(char **)Malloc(sizeof(char *)*MIN_NODES)) == NULL)

crypto/stack/stack.c:130:1: 
    128.   err1:
    129.   	Free((char *)ret);
    130. > err0:
    131.   	return(NULL);
    132.   	}

crypto/stack/stack.c:131:2: 
    129.   	Free((char *)ret);
    130.   err0:
    131. > 	return(NULL);
    132.   	}
    133.   

crypto/stack/stack.c:132:2: return from a call to sk_new
    130.   err0:
    131.   	return(NULL);
    132.   	}
            ^
    133.   
    134.   int sk_insert(STACK *st, char *data, int loc)

crypto/x509/x509_vfy.c:656:1: return from a call to sk_X509_ATTRIBUTE_new
  654.   IMPLEMENT_STACK_OF(X509_NAME)
  655.   
  656. > IMPLEMENT_STACK_OF(X509_ATTRIBUTE)
  657.   IMPLEMENT_ASN1_SET_OF(X509_ATTRIBUTE)

crypto/pkcs7/pk7_doit.c:920:1: 
918.   		{
919.   		*sk = sk_X509_ATTRIBUTE_new(NULL);
920. > new_attrib:
921.   		attr=X509_ATTRIBUTE_create(nid,atrtype,value);
922.   		sk_X509_ATTRIBUTE_push(*sk,attr);

crypto/pkcs7/pk7_doit.c:921:3: Skipping X509_ATTRIBUTE_create(): empty list of specs
919.   		*sk = sk_X509_ATTRIBUTE_new(NULL);
920.   new_attrib:
921.   		attr=X509_ATTRIBUTE_create(nid,atrtype,value);
         ^
922.   		sk_X509_ATTRIBUTE_push(*sk,attr);
923.   		}

crypto/pkcs7/pk7_doit.c:922:3: 
920.   new_attrib:
921.   		attr=X509_ATTRIBUTE_create(nid,atrtype,value);
922. > 		sk_X509_ATTRIBUTE_push(*sk,attr);
923.   		}
924.   	else

crypto/x509/x509_vfy.c:656:1: start of procedure sk_X509_ATTRIBUTE_push()
  654.   IMPLEMENT_STACK_OF(X509_NAME)
  655.   
  656. > IMPLEMENT_STACK_OF(X509_ATTRIBUTE)
  657.   IMPLEMENT_ASN1_SET_OF(X509_ATTRIBUTE)

crypto/stack/stack.c:233:1: start of procedure sk_push()
    231.   	}
    232.   
    233. > int sk_push(STACK *st, char *data)
    234.   	{
    235.   	return(sk_insert(st,data,st->num));

crypto/stack/stack.c:235:2: Skipping sk_insert(): empty list of specs
    233.   int sk_push(STACK *st, char *data)
    234.   	{
    235.   	return(sk_insert(st,data,st->num));
            ^
    236.   	}
    237.   
