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


crypto/pkcs7/example.c:278:1: start of procedure sk_get_seq2string()
276.   
277.   /* For this case, I will malloc the return strings */
278. > int sk_get_seq2string(STACK_OF(X509_ATTRIBUTE) *sk, char **str1, char **str2)
279.   	{
280.   	ASN1_TYPE *so;

crypto/pkcs7/example.c:283:6: Taking false branch
281.   	PKCS7_SIGNER_INFO si;
282.   
283.   	if (signed_seq2string_nid == -1)
            ^
284.   		signed_seq2string_nid=
285.   			OBJ_create("1.9.9999","OID_example","Our example OID");

crypto/pkcs7/example.c:287:2: 
285.   			OBJ_create("1.9.9999","OID_example","Our example OID");
286.   
287. > 	si.auth_attr=sk;
288.   	/* To retrieve */
289.   	so=PKCS7_get_signed_attribute(&si,signed_seq2string_nid);

crypto/pkcs7/example.c:289:2: 
287.   	si.auth_attr=sk;
288.   	/* To retrieve */
289. > 	so=PKCS7_get_signed_attribute(&si,signed_seq2string_nid);
290.   	if (so->type == V_ASN1_SEQUENCE)
291.   		{

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

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

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

crypto/pkcs7/pk7_doit.c:843:2: 
    841.   	ASN1_OBJECT *o;
    842.   
    843. > 	o=OBJ_nid2obj(nid);
    844.   	if (!o || !sk) return(NULL);
    845.   	for (i=0; i<sk_X509_ATTRIBUTE_num(sk); i++)

crypto/objects/obj_dat.c:254:1: start of procedure OBJ_nid2obj()
      252.   	}
      253.   
      254. > ASN1_OBJECT *OBJ_nid2obj(int n)
      255.   	{
      256.   	ADDED_OBJ ad,*adp;

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

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

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

crypto/objects/obj_dat.c:261:28: Taking true branch
      259.   	if ((n >= 0) && (n < NUM_NID))
      260.   		{
      261.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))
                                        ^
      262.   			{
      263.   			OBJerr(OBJ_F_OBJ_NID2OBJ,OBJ_R_UNKNOWN_NID);

crypto/objects/obj_dat.c:263:4: 
      261.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))
      262.   			{
      263. > 			OBJerr(OBJ_F_OBJ_NID2OBJ,OBJ_R_UNKNOWN_NID);
      264.   			return(NULL);
      265.   			}

crypto/err/err.c:245:1: start of procedure ERR_put_error()
        243.   /********************************************************/
        244.   
        245. > void ERR_put_error(int lib, int func, int reason, const char *file,
        246.   	     int line)
        247.   	{

crypto/err/err.c:269:2: Skipping ERR_get_state(): empty list of specs
        267.   	}
        268.   #endif
        269.   	es=ERR_get_state();
                ^
        270.   
        271.   	es->top=(es->top+1)%ERR_NUM_ERRORS;

crypto/err/err.c:271:2: 
        269.   	es=ERR_get_state();
        270.   
        271. > 	es->top=(es->top+1)%ERR_NUM_ERRORS;
        272.   	if (es->top == es->bottom)
        273.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;

crypto/err/err.c:272:6: Taking false branch
        270.   
        271.   	es->top=(es->top+1)%ERR_NUM_ERRORS;
        272.   	if (es->top == es->bottom)
                    ^
        273.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
        274.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);

crypto/err/err.c:274:2: 
        272.   	if (es->top == es->bottom)
        273.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
        274. > 	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
        275.   	es->err_file[es->top]=file;
        276.   	es->err_line[es->top]=line;

crypto/err/err.c:275:2: 
        273.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
        274.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
        275. > 	es->err_file[es->top]=file;
        276.   	es->err_line[es->top]=line;
        277.   	err_clear_data(es,es->top);

crypto/err/err.c:276:2: 
        274.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
        275.   	es->err_file[es->top]=file;
        276. > 	es->err_line[es->top]=line;
        277.   	err_clear_data(es,es->top);
        278.   	}

crypto/err/err.c:277:2: Taking true branch
        275.   	es->err_file[es->top]=file;
        276.   	es->err_line[es->top]=line;
        277.   	err_clear_data(es,es->top);
                ^
        278.   	}
        279.   

crypto/err/err.c:277:2: Taking false branch
        275.   	es->err_file[es->top]=file;
        276.   	es->err_line[es->top]=line;
        277.   	err_clear_data(es,es->top);
                ^
        278.   	}
        279.   

crypto/err/err.c:278:2: return from a call to ERR_put_error
        276.   	es->err_line[es->top]=line;
        277.   	err_clear_data(es,es->top);
        278.   	}
                ^
        279.   
        280.   void ERR_clear_error(void)

crypto/objects/obj_dat.c:264:4: 
      262.   			{
      263.   			OBJerr(OBJ_F_OBJ_NID2OBJ,OBJ_R_UNKNOWN_NID);
      264. > 			return(NULL);
      265.   			}
      266.   		return((ASN1_OBJECT *)&(nid_objs[n]));

crypto/objects/obj_dat.c:284:2: return from a call to OBJ_nid2obj
      282.   			}
      283.   		}
      284.   	}
              ^
      285.   
      286.   const char *OBJ_nid2sn(int n)

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

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

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

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

crypto/pkcs7/example.c:290:6: 
288.   	/* To retrieve */
289.   	so=PKCS7_get_signed_attribute(&si,signed_seq2string_nid);
290. > 	if (so->type == V_ASN1_SEQUENCE)
291.   		{
292.   		ASN1_CTX c;
