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


crypto/pkcs7/example.c:19:1: start of procedure get_signed_time()
17.   	}
18.   
19. > ASN1_UTCTIME *get_signed_time(PKCS7_SIGNER_INFO *si)
20.   	{
21.   	ASN1_TYPE *so;

crypto/pkcs7/example.c:23:2: 
21.   	ASN1_TYPE *so;
22.   
23. > 	so=PKCS7_get_signed_attribute(si,NID_pkcs9_signingTime);
24.   	if (so->type == V_ASN1_UTCTIME)
25.   	    return so->value.utctime;

crypto/pkcs7/pk7_doit.c:824:1: start of procedure PKCS7_get_signed_attribute()
  822.   	}
  823.   
  824. > ASN1_TYPE *PKCS7_get_signed_attribute(PKCS7_SIGNER_INFO *si, int nid)
  825.   	{
  826.   	return(get_attribute(si->auth_attr,nid));

crypto/pkcs7/pk7_doit.c:826:2: 
  824.   ASN1_TYPE *PKCS7_get_signed_attribute(PKCS7_SIGNER_INFO *si, int nid)
  825.   	{
  826. > 	return(get_attribute(si->auth_attr,nid));
  827.   	}
  828.   

crypto/pkcs7/pk7_doit.c:834:1: start of procedure get_attribute()
    832.   	}
    833.   
    834. > static ASN1_TYPE *get_attribute(STACK_OF(X509_ATTRIBUTE) *sk, int nid)
    835.   	{
    836.   	int i;

crypto/pkcs7/pk7_doit.c:840:2: 
    838.   	ASN1_OBJECT *o;
    839.   
    840. > 	o=OBJ_nid2obj(nid);
    841.   	if (!o || !sk) return(NULL);
    842.   	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:841:7: Taking false branch
    839.   
    840.   	o=OBJ_nid2obj(nid);
    841.   	if (!o || !sk) return(NULL);
                 ^
    842.   	for (i=0; i<sk_X509_ATTRIBUTE_num(sk); i++)
    843.   		{

crypto/pkcs7/pk7_doit.c:841:13: Taking true branch
    839.   
    840.   	o=OBJ_nid2obj(nid);
    841.   	if (!o || !sk) return(NULL);
                       ^
    842.   	for (i=0; i<sk_X509_ATTRIBUTE_num(sk); i++)
    843.   		{

crypto/pkcs7/pk7_doit.c:841:17: 
    839.   
    840.   	o=OBJ_nid2obj(nid);
    841. > 	if (!o || !sk) return(NULL);
    842.   	for (i=0; i<sk_X509_ATTRIBUTE_num(sk); i++)
    843.   		{

crypto/pkcs7/pk7_doit.c:854:2: return from a call to get_attribute
    852.   		}
    853.   	return(NULL);
    854.   	}
            ^
    855.   
    856.   ASN1_OCTET_STRING *PKCS7_digest_from_attributes(STACK_OF(X509_ATTRIBUTE) *sk)

crypto/pkcs7/pk7_doit.c:827:2: return from a call to PKCS7_get_signed_attribute
  825.   	{
  826.   	return(get_attribute(si->auth_attr,nid));
  827.   	}
          ^
  828.   
  829.   ASN1_TYPE *PKCS7_get_attribute(PKCS7_SIGNER_INFO *si, int nid)

crypto/pkcs7/example.c:24:6: 
22.   
23.   	so=PKCS7_get_signed_attribute(si,NID_pkcs9_signingTime);
24. > 	if (so->type == V_ASN1_UTCTIME)
25.   	    return so->value.utctime;
26.   	return NULL;
