crypto/pkcs7/example.c:185: error: NULL_DEREFERENCE
  pointer `so` last assigned on line 184 could be null and is dereferenced at line 185, column 6.
Showing all 20 steps of the trace


crypto/pkcs7/example.c:178:1: start of procedure sk_get_time()
176.   	}
177.   
178. > ASN1_UTCTIME *sk_get_time(STACK_OF(X509_ATTRIBUTE) *sk)
179.   	{
180.   	ASN1_TYPE *so;

crypto/pkcs7/example.c:183:2: 
181.   	PKCS7_SIGNER_INFO si;
182.   
183. > 	si.auth_attr=sk;
184.   	so=PKCS7_get_signed_attribute(&si,NID_pkcs9_signingTime);
185.   	if (so->type == V_ASN1_UTCTIME)

crypto/pkcs7/example.c:184:2: 
182.   
183.   	si.auth_attr=sk;
184. > 	so=PKCS7_get_signed_attribute(&si,NID_pkcs9_signingTime);
185.   	if (so->type == V_ASN1_UTCTIME)
186.   	    return so->value.utctime;

crypto/pkcs7/pk7_doit.c:813:1: start of procedure PKCS7_get_signed_attribute()
  811.   	}
  812.   
  813. > ASN1_TYPE *PKCS7_get_signed_attribute(PKCS7_SIGNER_INFO *si, int nid)
  814.   	{
  815.   	return(get_attribute(si->auth_attr,nid));

crypto/pkcs7/pk7_doit.c:815:2: 
  813.   ASN1_TYPE *PKCS7_get_signed_attribute(PKCS7_SIGNER_INFO *si, int nid)
  814.   	{
  815. > 	return(get_attribute(si->auth_attr,nid));
  816.   	}
  817.   

crypto/pkcs7/pk7_doit.c:823:1: start of procedure get_attribute()
    821.   	}
    822.   
    823. > static ASN1_TYPE *get_attribute(STACK_OF(X509_ATTRIBUTE) *sk, int nid)
    824.   	{
    825.   	int i;

crypto/pkcs7/pk7_doit.c:829:2: 
    827.   	ASN1_OBJECT *o;
    828.   
    829. > 	o=OBJ_nid2obj(nid);
    830.   	if (!o || !sk) return(NULL);
    831.   	for (i=0; i<sk_X509_ATTRIBUTE_num(sk); i++)

crypto/objects/obj_dat.c:258:1: start of procedure OBJ_nid2obj()
      256.   	}
      257.   
      258. > ASN1_OBJECT *OBJ_nid2obj(int n)
      259.   	{
      260.   	ADDED_OBJ ad,*adp;

crypto/objects/obj_dat.c:263:7: Taking true branch
      261.   	ASN1_OBJECT ob;
      262.   
      263.   	if ((n >= 0) && (n < NUM_NID))
                   ^
      264.   		{
      265.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))

crypto/objects/obj_dat.c:263:19: Taking true branch
      261.   	ASN1_OBJECT ob;
      262.   
      263.   	if ((n >= 0) && (n < NUM_NID))
                               ^
      264.   		{
      265.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))

crypto/objects/obj_dat.c:265:8: Taking true branch
      263.   	if ((n >= 0) && (n < NUM_NID))
      264.   		{
      265.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))
                    ^
      266.   			{
      267.   			OBJerr(OBJ_F_OBJ_NID2OBJ,OBJ_R_UNKNOWN_NID);

crypto/objects/obj_dat.c:265:28: Taking false branch
      263.   	if ((n >= 0) && (n < NUM_NID))
      264.   		{
      265.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))
                                        ^
      266.   			{
      267.   			OBJerr(OBJ_F_OBJ_NID2OBJ,OBJ_R_UNKNOWN_NID);

crypto/objects/obj_dat.c:270:3: 
      268.   			return(NULL);
      269.   			}
      270. > 		return((ASN1_OBJECT *)&(nid_objs[n]));
      271.   		}
      272.   	else if (added == NULL)

crypto/objects/obj_dat.c:288:2: return from a call to OBJ_nid2obj
      286.   			}
      287.   		}
      288.   	}
              ^
      289.   
      290.   const char *OBJ_nid2sn(int n)

crypto/pkcs7/pk7_doit.c:830:7: Taking false branch
    828.   
    829.   	o=OBJ_nid2obj(nid);
    830.   	if (!o || !sk) return(NULL);
                 ^
    831.   	for (i=0; i<sk_X509_ATTRIBUTE_num(sk); i++)
    832.   		{

crypto/pkcs7/pk7_doit.c:830:13: Taking true branch
    828.   
    829.   	o=OBJ_nid2obj(nid);
    830.   	if (!o || !sk) return(NULL);
                       ^
    831.   	for (i=0; i<sk_X509_ATTRIBUTE_num(sk); i++)
    832.   		{

crypto/pkcs7/pk7_doit.c:830:17: 
    828.   
    829.   	o=OBJ_nid2obj(nid);
    830. > 	if (!o || !sk) return(NULL);
    831.   	for (i=0; i<sk_X509_ATTRIBUTE_num(sk); i++)
    832.   		{

crypto/pkcs7/pk7_doit.c:843:2: return from a call to get_attribute
    841.   		}
    842.   	return(NULL);
    843.   	}
            ^
    844.   
    845.   ASN1_OCTET_STRING *PKCS7_digest_from_attributes(STACK_OF(X509_ATTRIBUTE) *sk)

crypto/pkcs7/pk7_doit.c:816:2: return from a call to PKCS7_get_signed_attribute
  814.   	{
  815.   	return(get_attribute(si->auth_attr,nid));
  816.   	}
          ^
  817.   
  818.   ASN1_TYPE *PKCS7_get_attribute(PKCS7_SIGNER_INFO *si, int nid)

crypto/pkcs7/example.c:185:6: 
183.   	si.auth_attr=sk;
184.   	so=PKCS7_get_signed_attribute(&si,NID_pkcs9_signingTime);
185. > 	if (so->type == V_ASN1_UTCTIME)
186.   	    return so->value.utctime;
187.   	return NULL;
