crypto/cms/cms_ess.c:407: error: NULL_DEREFERENCE
  pointer `rr` last assigned on line 388 could be null and is dereferenced at line 407, column 32.
Showing all 49 steps of the trace


crypto/cms/cms_ess.c:377:1: start of procedure cms_encode_Receipt()
375.    */
376.   
377. > ASN1_OCTET_STRING *cms_encode_Receipt(CMS_SignerInfo *si)
378.   	{
379.   	CMS_Receipt rct;

crypto/cms/cms_ess.c:380:2: 
378.   	{
379.   	CMS_Receipt rct;
380. > 	CMS_ReceiptRequest *rr = NULL;
381.   	ASN1_OBJECT *ctype;
382.   	ASN1_OCTET_STRING *os = NULL;

crypto/cms/cms_ess.c:382:2: 
380.   	CMS_ReceiptRequest *rr = NULL;
381.   	ASN1_OBJECT *ctype;
382. > 	ASN1_OCTET_STRING *os = NULL;
383.   
384.   	/* Get original receipt request */

crypto/cms/cms_ess.c:388:7: 
386.   	/* Get original receipt request details */
387.   
388. > 	if (!CMS_get1_ReceiptRequest(si, &rr))
389.   		{
390.   		CMSerr(CMS_F_CMS_ENCODE_RECEIPT, CMS_R_NO_RECEIPT_REQUEST);

crypto/cms/cms_ess.c:70:1: start of procedure CMS_get1_ReceiptRequest()
  68.   /* ESS services: for now just Signed Receipt related */
  69.   
  70. > int CMS_get1_ReceiptRequest(CMS_SignerInfo *si, CMS_ReceiptRequest **prr)
  71.   	{
  72.   	ASN1_STRING *str;

crypto/cms/cms_ess.c:73:2: 
  71.   	{
  72.   	ASN1_STRING *str;
  73. > 	CMS_ReceiptRequest *rr = NULL;
  74.   	if (prr)
  75.   		*prr = NULL;

crypto/cms/cms_ess.c:74:6: Taking true branch
  72.   	ASN1_STRING *str;
  73.   	CMS_ReceiptRequest *rr = NULL;
  74.   	if (prr)
             ^
  75.   		*prr = NULL;
  76.   	str = CMS_signed_get0_data_by_OBJ(si,

crypto/cms/cms_ess.c:75:3: 
  73.   	CMS_ReceiptRequest *rr = NULL;
  74.   	if (prr)
  75. > 		*prr = NULL;
  76.   	str = CMS_signed_get0_data_by_OBJ(si,
  77.   				OBJ_nid2obj(NID_id_smime_aa_receiptRequest),

crypto/cms/cms_ess.c:76:2: 
  74.   	if (prr)
  75.   		*prr = NULL;
  76. > 	str = CMS_signed_get0_data_by_OBJ(si,
  77.   				OBJ_nid2obj(NID_id_smime_aa_receiptRequest),
  78.   					-3, V_ASN1_SEQUENCE);

crypto/objects/obj_dat.c:294:1: start of procedure OBJ_nid2obj()
    292.   	}
    293.   
    294. > ASN1_OBJECT *OBJ_nid2obj(int n)
    295.   	{
    296.   	ADDED_OBJ ad,*adp;

crypto/objects/obj_dat.c:299:7: Taking true branch
    297.   	ASN1_OBJECT ob;
    298.   
    299.   	if ((n >= 0) && (n < NUM_NID))
                 ^
    300.   		{
    301.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))

crypto/objects/obj_dat.c:299:19: Taking true branch
    297.   	ASN1_OBJECT ob;
    298.   
    299.   	if ((n >= 0) && (n < NUM_NID))
                             ^
    300.   		{
    301.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))

crypto/objects/obj_dat.c:301:8: Taking true branch
    299.   	if ((n >= 0) && (n < NUM_NID))
    300.   		{
    301.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))
                  ^
    302.   			{
    303.   			OBJerr(OBJ_F_OBJ_NID2OBJ,OBJ_R_UNKNOWN_NID);

crypto/objects/obj_dat.c:301:28: Taking true branch
    299.   	if ((n >= 0) && (n < NUM_NID))
    300.   		{
    301.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))
                                      ^
    302.   			{
    303.   			OBJerr(OBJ_F_OBJ_NID2OBJ,OBJ_R_UNKNOWN_NID);

crypto/objects/obj_dat.c:303:4: 
    301.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))
    302.   			{
    303. > 			OBJerr(OBJ_F_OBJ_NID2OBJ,OBJ_R_UNKNOWN_NID);
    304.   			return(NULL);
    305.   			}

crypto/err/err.c:681:1: start of procedure ERR_put_error()
      679.   /********************************************************/
      680.   
      681. > void ERR_put_error(int lib, int func, int reason, const char *file,
      682.   	     int line)
      683.   	{

crypto/err/err.c:705:2: Skipping ERR_get_state(): empty list of specs
      703.   	}
      704.   #endif
      705.   	es=ERR_get_state();
              ^
      706.   
      707.   	es->top=(es->top+1)%ERR_NUM_ERRORS;

crypto/err/err.c:707:2: 
      705.   	es=ERR_get_state();
      706.   
      707. > 	es->top=(es->top+1)%ERR_NUM_ERRORS;
      708.   	if (es->top == es->bottom)
      709.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;

crypto/err/err.c:708:6: Taking false branch
      706.   
      707.   	es->top=(es->top+1)%ERR_NUM_ERRORS;
      708.   	if (es->top == es->bottom)
                  ^
      709.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
      710.   	es->err_flags[es->top]=0;

crypto/err/err.c:710:2: 
      708.   	if (es->top == es->bottom)
      709.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
      710. > 	es->err_flags[es->top]=0;
      711.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
      712.   	es->err_file[es->top]=file;

crypto/err/err.c:711:2: 
      709.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
      710.   	es->err_flags[es->top]=0;
      711. > 	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
      712.   	es->err_file[es->top]=file;
      713.   	es->err_line[es->top]=line;

crypto/err/err.c:712:2: 
      710.   	es->err_flags[es->top]=0;
      711.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
      712. > 	es->err_file[es->top]=file;
      713.   	es->err_line[es->top]=line;
      714.   	err_clear_data(es,es->top);

crypto/err/err.c:713:2: 
      711.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
      712.   	es->err_file[es->top]=file;
      713. > 	es->err_line[es->top]=line;
      714.   	err_clear_data(es,es->top);
      715.   	}

crypto/err/err.c:714:2: Taking true branch
      712.   	es->err_file[es->top]=file;
      713.   	es->err_line[es->top]=line;
      714.   	err_clear_data(es,es->top);
              ^
      715.   	}
      716.   

crypto/err/err.c:714:2: Taking false branch
      712.   	es->err_file[es->top]=file;
      713.   	es->err_line[es->top]=line;
      714.   	err_clear_data(es,es->top);
              ^
      715.   	}
      716.   

crypto/err/err.c:714:2: Loop condition is false. Leaving loop
      712.   	es->err_file[es->top]=file;
      713.   	es->err_line[es->top]=line;
      714.   	err_clear_data(es,es->top);
              ^
      715.   	}
      716.   

crypto/err/err.c:715:2: return from a call to ERR_put_error
      713.   	es->err_line[es->top]=line;
      714.   	err_clear_data(es,es->top);
      715.   	}
              ^
      716.   
      717.   void ERR_clear_error(void)

crypto/objects/obj_dat.c:304:4: 
    302.   			{
    303.   			OBJerr(OBJ_F_OBJ_NID2OBJ,OBJ_R_UNKNOWN_NID);
    304. > 			return(NULL);
    305.   			}
    306.   		return((ASN1_OBJECT *)&(nid_objs[n]));

crypto/objects/obj_dat.c:324:2: return from a call to OBJ_nid2obj
    322.   			}
    323.   		}
    324.   	}
            ^
    325.   
    326.   const char *OBJ_nid2sn(int n)

crypto/cms/cms_ess.c:76:2: Skipping CMS_signed_get0_data_by_OBJ(): empty list of specs
  74.   	if (prr)
  75.   		*prr = NULL;
  76.   	str = CMS_signed_get0_data_by_OBJ(si,
         ^
  77.   				OBJ_nid2obj(NID_id_smime_aa_receiptRequest),
  78.   					-3, V_ASN1_SEQUENCE);

crypto/cms/cms_ess.c:79:7: Taking false branch
  77.   				OBJ_nid2obj(NID_id_smime_aa_receiptRequest),
  78.   					-3, V_ASN1_SEQUENCE);
  79.   	if (!str)
              ^
  80.   		return 0;
  81.   

crypto/cms/cms_ess.c:82:2: Skipping ASN1_item_unpack(): empty list of specs
  80.   		return 0;
  81.   
  82.   	rr = ASN1_item_unpack(str, ASN1_ITEM_rptr(CMS_ReceiptRequest));
         ^
  83.   	if (!rr)
  84.   		return -1;

crypto/cms/cms_ess.c:83:7: Taking true branch
  81.   
  82.   	rr = ASN1_item_unpack(str, ASN1_ITEM_rptr(CMS_ReceiptRequest));
  83.   	if (!rr)
              ^
  84.   		return -1;
  85.   	if (prr)

crypto/cms/cms_ess.c:84:3: 
  82.   	rr = ASN1_item_unpack(str, ASN1_ITEM_rptr(CMS_ReceiptRequest));
  83.   	if (!rr)
  84. > 		return -1;
  85.   	if (prr)
  86.   		*prr = rr;

crypto/cms/cms_ess.c:90:2: return from a call to CMS_get1_ReceiptRequest
  88.   		CMS_ReceiptRequest_free(rr);
  89.   	return 1;
  90.   	}
         ^
  91.   
  92.   CMS_ReceiptRequest *CMS_ReceiptRequest_create0(unsigned char *id, int idlen,

crypto/cms/cms_ess.c:388:7: Taking false branch
386.   	/* Get original receipt request details */
387.   
388.   	if (!CMS_get1_ReceiptRequest(si, &rr))
             ^
389.   		{
390.   		CMSerr(CMS_F_CMS_ENCODE_RECEIPT, CMS_R_NO_RECEIPT_REQUEST);

crypto/cms/cms_ess.c:396:2: 
394.   	/* Get original content type */
395.   
396. > 	ctype = CMS_signed_get0_data_by_OBJ(si,
397.   				OBJ_nid2obj(NID_pkcs9_contentType),
398.   					-3, V_ASN1_OBJECT);

crypto/objects/obj_dat.c:294:1: start of procedure OBJ_nid2obj()
  292.   	}
  293.   
  294. > ASN1_OBJECT *OBJ_nid2obj(int n)
  295.   	{
  296.   	ADDED_OBJ ad,*adp;

crypto/objects/obj_dat.c:299:7: Taking true branch
  297.   	ASN1_OBJECT ob;
  298.   
  299.   	if ((n >= 0) && (n < NUM_NID))
               ^
  300.   		{
  301.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))

crypto/objects/obj_dat.c:299:19: Taking true branch
  297.   	ASN1_OBJECT ob;
  298.   
  299.   	if ((n >= 0) && (n < NUM_NID))
                           ^
  300.   		{
  301.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))

crypto/objects/obj_dat.c:301:8: Taking true branch
  299.   	if ((n >= 0) && (n < NUM_NID))
  300.   		{
  301.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))
                ^
  302.   			{
  303.   			OBJerr(OBJ_F_OBJ_NID2OBJ,OBJ_R_UNKNOWN_NID);

crypto/objects/obj_dat.c:301:28: Taking false branch
  299.   	if ((n >= 0) && (n < NUM_NID))
  300.   		{
  301.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))
                                    ^
  302.   			{
  303.   			OBJerr(OBJ_F_OBJ_NID2OBJ,OBJ_R_UNKNOWN_NID);

crypto/objects/obj_dat.c:306:3: 
  304.   			return(NULL);
  305.   			}
  306. > 		return((ASN1_OBJECT *)&(nid_objs[n]));
  307.   		}
  308.   	else if (added == NULL)

crypto/objects/obj_dat.c:324:2: return from a call to OBJ_nid2obj
  322.   			}
  323.   		}
  324.   	}
          ^
  325.   
  326.   const char *OBJ_nid2sn(int n)

crypto/cms/cms_ess.c:396:2: Skipping CMS_signed_get0_data_by_OBJ(): empty list of specs
394.   	/* Get original content type */
395.   
396.   	ctype = CMS_signed_get0_data_by_OBJ(si,
        ^
397.   				OBJ_nid2obj(NID_pkcs9_contentType),
398.   					-3, V_ASN1_OBJECT);

crypto/cms/cms_ess.c:399:7: Taking false branch
397.   				OBJ_nid2obj(NID_pkcs9_contentType),
398.   					-3, V_ASN1_OBJECT);
399.   	if (!ctype)
             ^
400.   		{
401.   		CMSerr(CMS_F_CMS_ENCODE_RECEIPT, CMS_R_NO_CONTENT_TYPE);

crypto/cms/cms_ess.c:405:2: 
403.   		}
404.   
405. > 	rct.version = 1;
406.   	rct.contentType = ctype;
407.   	rct.signedContentIdentifier = rr->signedContentIdentifier;

crypto/cms/cms_ess.c:406:2: 
404.   
405.   	rct.version = 1;
406. > 	rct.contentType = ctype;
407.   	rct.signedContentIdentifier = rr->signedContentIdentifier;
408.   	rct.originatorSignatureValue = si->signature;

crypto/cms/cms_ess.c:407:2: 
405.   	rct.version = 1;
406.   	rct.contentType = ctype;
407. > 	rct.signedContentIdentifier = rr->signedContentIdentifier;
408.   	rct.originatorSignatureValue = si->signature;
409.   
