crypto/ocsp/ocsp_ext.c:364: error: NULL_DEREFERENCE
  pointer `resp_ext` last assigned on line 363 could be null and is dereferenced at line 364, column 43.
Showing all 72 steps of the trace


crypto/ocsp/ocsp_ext.c:336:1: start of procedure OCSP_check_nonce()
334.    * must be either absent in both or present and equal in both. 
335.    */
336. > int OCSP_check_nonce(OCSP_REQUEST *req, OCSP_BASICRESP *bs)
337.   	{
338.   	/*

crypto/ocsp/ocsp_ext.c:346:2: 
344.   	 */
345.   
346. > 	int ret = 0, req_idx, resp_idx;
347.   	X509_EXTENSION *req_ext, *resp_ext;
348.   	req_idx = OCSP_REQUEST_get_ext_by_NID(req, NID_id_pkix_OCSP_Nonce, -1);

crypto/ocsp/ocsp_ext.c:348:2: 
346.   	int ret = 0, req_idx, resp_idx;
347.   	X509_EXTENSION *req_ext, *resp_ext;
348. > 	req_idx = OCSP_REQUEST_get_ext_by_NID(req, NID_id_pkix_OCSP_Nonce, -1);
349.   	resp_idx = OCSP_BASICRESP_get_ext_by_NID(bs, NID_id_pkix_OCSP_Nonce, -1);
350.   	/* If both absent its OK */

crypto/ocsp/ocsp_ext.c:81:1: start of procedure OCSP_REQUEST_get_ext_by_NID()
  79.   	}
  80.   
  81. > int OCSP_REQUEST_get_ext_by_NID(OCSP_REQUEST *x, int nid, int lastpos)
  82.   	{
  83.   	return(X509v3_get_ext_by_NID(x->tbsRequest->requestExtensions,nid,lastpos));

crypto/ocsp/ocsp_ext.c:83:2: 
  81.   int OCSP_REQUEST_get_ext_by_NID(OCSP_REQUEST *x, int nid, int lastpos)
  82.   	{
  83. > 	return(X509v3_get_ext_by_NID(x->tbsRequest->requestExtensions,nid,lastpos));
  84.   	}
  85.   

crypto/x509/x509_v3.c:74:1: start of procedure X509v3_get_ext_by_NID()
    72.   	}
    73.   
    74. > int X509v3_get_ext_by_NID(const STACK_OF(X509_EXTENSION) *x, int nid,
    75.   			  int lastpos)
    76.   	{

crypto/x509/x509_v3.c:79:2: 
    77.   	ASN1_OBJECT *obj;
    78.   
    79. > 	obj=OBJ_nid2obj(nid);
    80.   	if (obj == NULL) return(-2);
    81.   	return(X509v3_get_ext_by_OBJ(x,obj,lastpos));

crypto/objects/obj_dat.c:267:1: start of procedure OBJ_nid2obj()
      265.   	}
      266.   
      267. > ASN1_OBJECT *OBJ_nid2obj(int n)
      268.   	{
      269.   	ADDED_OBJ ad,*adp;

crypto/objects/obj_dat.c:272:7: Taking true branch
      270.   	ASN1_OBJECT ob;
      271.   
      272.   	if ((n >= 0) && (n < NUM_NID))
                   ^
      273.   		{
      274.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))

crypto/objects/obj_dat.c:272:19: Taking true branch
      270.   	ASN1_OBJECT ob;
      271.   
      272.   	if ((n >= 0) && (n < NUM_NID))
                               ^
      273.   		{
      274.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))

crypto/objects/obj_dat.c:274:8: Taking true branch
      272.   	if ((n >= 0) && (n < NUM_NID))
      273.   		{
      274.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))
                    ^
      275.   			{
      276.   			OBJerr(OBJ_F_OBJ_NID2OBJ,OBJ_R_UNKNOWN_NID);

crypto/objects/obj_dat.c:274:28: Taking false branch
      272.   	if ((n >= 0) && (n < NUM_NID))
      273.   		{
      274.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))
                                        ^
      275.   			{
      276.   			OBJerr(OBJ_F_OBJ_NID2OBJ,OBJ_R_UNKNOWN_NID);

crypto/objects/obj_dat.c:279:3: 
      277.   			return(NULL);
      278.   			}
      279. > 		return((ASN1_OBJECT *)&(nid_objs[n]));
      280.   		}
      281.   	else if (added == NULL)

crypto/objects/obj_dat.c:297:2: return from a call to OBJ_nid2obj
      295.   			}
      296.   		}
      297.   	}
              ^
      298.   
      299.   const char *OBJ_nid2sn(int n)

crypto/x509/x509_v3.c:80:6: Taking false branch
    78.   
    79.   	obj=OBJ_nid2obj(nid);
    80.   	if (obj == NULL) return(-2);
               ^
    81.   	return(X509v3_get_ext_by_OBJ(x,obj,lastpos));
    82.   	}

crypto/x509/x509_v3.c:81:2: Skipping X509v3_get_ext_by_OBJ(): empty list of specs
    79.   	obj=OBJ_nid2obj(nid);
    80.   	if (obj == NULL) return(-2);
    81.   	return(X509v3_get_ext_by_OBJ(x,obj,lastpos));
           ^
    82.   	}
    83.   

crypto/x509/x509_v3.c:82:2: return from a call to X509v3_get_ext_by_NID
    80.   	if (obj == NULL) return(-2);
    81.   	return(X509v3_get_ext_by_OBJ(x,obj,lastpos));
    82.   	}
           ^
    83.   
    84.   int X509v3_get_ext_by_OBJ(const STACK_OF(X509_EXTENSION) *sk, ASN1_OBJECT *obj,

crypto/ocsp/ocsp_ext.c:84:2: return from a call to OCSP_REQUEST_get_ext_by_NID
  82.   	{
  83.   	return(X509v3_get_ext_by_NID(x->tbsRequest->requestExtensions,nid,lastpos));
  84.   	}
         ^
  85.   
  86.   int OCSP_REQUEST_get_ext_by_OBJ(OCSP_REQUEST *x, ASN1_OBJECT *obj, int lastpos)

crypto/ocsp/ocsp_ext.c:349:2: 
347.   	X509_EXTENSION *req_ext, *resp_ext;
348.   	req_idx = OCSP_REQUEST_get_ext_by_NID(req, NID_id_pkix_OCSP_Nonce, -1);
349. > 	resp_idx = OCSP_BASICRESP_get_ext_by_NID(bs, NID_id_pkix_OCSP_Nonce, -1);
350.   	/* If both absent its OK */
351.   	if((req_idx < 0) && (resp_idx < 0)) return 1;

crypto/ocsp/ocsp_ext.c:177:1: start of procedure OCSP_BASICRESP_get_ext_by_NID()
  175.   	}
  176.   
  177. > int OCSP_BASICRESP_get_ext_by_NID(OCSP_BASICRESP *x, int nid, int lastpos)
  178.   	{
  179.   	return(X509v3_get_ext_by_NID(x->tbsResponseData->responseExtensions,nid,lastpos));

crypto/ocsp/ocsp_ext.c:179:2: 
  177.   int OCSP_BASICRESP_get_ext_by_NID(OCSP_BASICRESP *x, int nid, int lastpos)
  178.   	{
  179. > 	return(X509v3_get_ext_by_NID(x->tbsResponseData->responseExtensions,nid,lastpos));
  180.   	}
  181.   

crypto/x509/x509_v3.c:74:1: start of procedure X509v3_get_ext_by_NID()
    72.   	}
    73.   
    74. > int X509v3_get_ext_by_NID(const STACK_OF(X509_EXTENSION) *x, int nid,
    75.   			  int lastpos)
    76.   	{

crypto/x509/x509_v3.c:79:2: 
    77.   	ASN1_OBJECT *obj;
    78.   
    79. > 	obj=OBJ_nid2obj(nid);
    80.   	if (obj == NULL) return(-2);
    81.   	return(X509v3_get_ext_by_OBJ(x,obj,lastpos));

crypto/objects/obj_dat.c:267:1: start of procedure OBJ_nid2obj()
      265.   	}
      266.   
      267. > ASN1_OBJECT *OBJ_nid2obj(int n)
      268.   	{
      269.   	ADDED_OBJ ad,*adp;

crypto/objects/obj_dat.c:272:7: Taking true branch
      270.   	ASN1_OBJECT ob;
      271.   
      272.   	if ((n >= 0) && (n < NUM_NID))
                   ^
      273.   		{
      274.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))

crypto/objects/obj_dat.c:272:19: Taking true branch
      270.   	ASN1_OBJECT ob;
      271.   
      272.   	if ((n >= 0) && (n < NUM_NID))
                               ^
      273.   		{
      274.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))

crypto/objects/obj_dat.c:274:8: Taking true branch
      272.   	if ((n >= 0) && (n < NUM_NID))
      273.   		{
      274.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))
                    ^
      275.   			{
      276.   			OBJerr(OBJ_F_OBJ_NID2OBJ,OBJ_R_UNKNOWN_NID);

crypto/objects/obj_dat.c:274:28: Taking false branch
      272.   	if ((n >= 0) && (n < NUM_NID))
      273.   		{
      274.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))
                                        ^
      275.   			{
      276.   			OBJerr(OBJ_F_OBJ_NID2OBJ,OBJ_R_UNKNOWN_NID);

crypto/objects/obj_dat.c:279:3: 
      277.   			return(NULL);
      278.   			}
      279. > 		return((ASN1_OBJECT *)&(nid_objs[n]));
      280.   		}
      281.   	else if (added == NULL)

crypto/objects/obj_dat.c:297:2: return from a call to OBJ_nid2obj
      295.   			}
      296.   		}
      297.   	}
              ^
      298.   
      299.   const char *OBJ_nid2sn(int n)

crypto/x509/x509_v3.c:80:6: Taking false branch
    78.   
    79.   	obj=OBJ_nid2obj(nid);
    80.   	if (obj == NULL) return(-2);
               ^
    81.   	return(X509v3_get_ext_by_OBJ(x,obj,lastpos));
    82.   	}

crypto/x509/x509_v3.c:81:2: Skipping X509v3_get_ext_by_OBJ(): empty list of specs
    79.   	obj=OBJ_nid2obj(nid);
    80.   	if (obj == NULL) return(-2);
    81.   	return(X509v3_get_ext_by_OBJ(x,obj,lastpos));
           ^
    82.   	}
    83.   

crypto/x509/x509_v3.c:82:2: return from a call to X509v3_get_ext_by_NID
    80.   	if (obj == NULL) return(-2);
    81.   	return(X509v3_get_ext_by_OBJ(x,obj,lastpos));
    82.   	}
           ^
    83.   
    84.   int X509v3_get_ext_by_OBJ(const STACK_OF(X509_EXTENSION) *sk, ASN1_OBJECT *obj,

crypto/ocsp/ocsp_ext.c:180:2: return from a call to OCSP_BASICRESP_get_ext_by_NID
  178.   	{
  179.   	return(X509v3_get_ext_by_NID(x->tbsResponseData->responseExtensions,nid,lastpos));
  180.   	}
          ^
  181.   
  182.   int OCSP_BASICRESP_get_ext_by_OBJ(OCSP_BASICRESP *x, ASN1_OBJECT *obj, int lastpos)

crypto/ocsp/ocsp_ext.c:351:6: Taking false branch
349.   	resp_idx = OCSP_BASICRESP_get_ext_by_NID(bs, NID_id_pkix_OCSP_Nonce, -1);
350.   	/* If both absent its OK */
351.   	if((req_idx < 0) && (resp_idx < 0)) return 1;
            ^
352.   	if((req_idx < 0) && (resp_idx >= 0))
353.   		{

crypto/ocsp/ocsp_ext.c:352:6: Taking false branch
350.   	/* If both absent its OK */
351.   	if((req_idx < 0) && (resp_idx < 0)) return 1;
352.   	if((req_idx < 0) && (resp_idx >= 0))
            ^
353.   		{
354.   		OCSPerr(OCSP_F_OCSP_CHECK_NONCE, OCSP_R_NONCE_MISSING_IN_RESPONSE);

crypto/ocsp/ocsp_ext.c:357:6: Taking false branch
355.   		goto err;
356.   		}
357.   	if((req_idx < 0) && (resp_idx >= 0))
            ^
358.   		{
359.   		OCSPerr(OCSP_F_OCSP_CHECK_NONCE, OCSP_R_UNEXPECTED_NONCE_IN_RESPONSE);

crypto/ocsp/ocsp_ext.c:362:2: 
360.   		goto err;
361.   		}
362. > 	req_ext = OCSP_REQUEST_get_ext(req, req_idx);
363.   	resp_ext = OCSP_BASICRESP_get_ext(bs, resp_idx);
364.   	if(ASN1_OCTET_STRING_cmp(req_ext->value, resp_ext->value))

crypto/ocsp/ocsp_ext.c:96:1: start of procedure OCSP_REQUEST_get_ext()
  94.   	}
  95.   
  96. > X509_EXTENSION *OCSP_REQUEST_get_ext(OCSP_REQUEST *x, int loc)
  97.   	{
  98.   	return(X509v3_get_ext(x->tbsRequest->requestExtensions,loc));

crypto/ocsp/ocsp_ext.c:98:2: 
  96.   X509_EXTENSION *OCSP_REQUEST_get_ext(OCSP_REQUEST *x, int loc)
  97.   	{
  98. > 	return(X509v3_get_ext(x->tbsRequest->requestExtensions,loc));
  99.   	}
  100.   

crypto/x509/x509_v3.c:125:1: start of procedure X509v3_get_ext()
    123.   	}
    124.   
    125. > X509_EXTENSION *X509v3_get_ext(const STACK_OF(X509_EXTENSION) *x, int loc)
    126.   	{
    127.   	if (x == NULL || sk_X509_EXTENSION_num(x) <= loc || loc < 0)

crypto/x509/x509_v3.c:127:6: Taking false branch
    125.   X509_EXTENSION *X509v3_get_ext(const STACK_OF(X509_EXTENSION) *x, int loc)
    126.   	{
    127.   	if (x == NULL || sk_X509_EXTENSION_num(x) <= loc || loc < 0)
                ^
    128.   		return NULL;
    129.   	else

crypto/x509/x509_v3.c:127:19: 
    125.   X509_EXTENSION *X509v3_get_ext(const STACK_OF(X509_EXTENSION) *x, int loc)
    126.   	{
    127. > 	if (x == NULL || sk_X509_EXTENSION_num(x) <= loc || loc < 0)
    128.   		return NULL;
    129.   	else

crypto/stack/stack.c:299:1: start of procedure sk_num()
      297.   	}
      298.   
      299. > int sk_num(const STACK *st)
      300.   {
      301.   	if(st == NULL) return -1;

crypto/stack/stack.c:301:5: Taking false branch
      299.   int sk_num(const STACK *st)
      300.   {
      301.   	if(st == NULL) return -1;
                 ^
      302.   	return st->num;
      303.   }

crypto/stack/stack.c:302:2: 
      300.   {
      301.   	if(st == NULL) return -1;
      302. > 	return st->num;
      303.   }
      304.   

crypto/stack/stack.c:303:1: return from a call to sk_num
      301.   	if(st == NULL) return -1;
      302.   	return st->num;
      303. > }
      304.   
      305.   char *sk_value(const STACK *st, int i)

crypto/x509/x509_v3.c:127:19: Taking false branch
    125.   X509_EXTENSION *X509v3_get_ext(const STACK_OF(X509_EXTENSION) *x, int loc)
    126.   	{
    127.   	if (x == NULL || sk_X509_EXTENSION_num(x) <= loc || loc < 0)
                             ^
    128.   		return NULL;
    129.   	else

crypto/x509/x509_v3.c:127:54: Taking false branch
    125.   X509_EXTENSION *X509v3_get_ext(const STACK_OF(X509_EXTENSION) *x, int loc)
    126.   	{
    127.   	if (x == NULL || sk_X509_EXTENSION_num(x) <= loc || loc < 0)
                                                                ^
    128.   		return NULL;
    129.   	else

crypto/x509/x509_v3.c:130:3: 
    128.   		return NULL;
    129.   	else
    130. > 		return sk_X509_EXTENSION_value(x,loc);
    131.   	}
    132.   

crypto/stack/stack.c:305:1: start of procedure sk_value()
      303.   }
      304.   
      305. > char *sk_value(const STACK *st, int i)
      306.   {
      307.   	if(st == NULL) return NULL;

crypto/stack/stack.c:307:5: Taking false branch
      305.   char *sk_value(const STACK *st, int i)
      306.   {
      307.   	if(st == NULL) return NULL;
                 ^
      308.   	return st->data[i];
      309.   }

crypto/stack/stack.c:308:2: 
      306.   {
      307.   	if(st == NULL) return NULL;
      308. > 	return st->data[i];
      309.   }
      310.   

crypto/stack/stack.c:309:1: return from a call to sk_value
      307.   	if(st == NULL) return NULL;
      308.   	return st->data[i];
      309. > }
      310.   
      311.   char *sk_set(STACK *st, int i, char *value)

crypto/x509/x509_v3.c:131:2: return from a call to X509v3_get_ext
    129.   	else
    130.   		return sk_X509_EXTENSION_value(x,loc);
    131.   	}
            ^
    132.   
    133.   X509_EXTENSION *X509v3_delete_ext(STACK_OF(X509_EXTENSION) *x, int loc)

crypto/ocsp/ocsp_ext.c:99:2: return from a call to OCSP_REQUEST_get_ext
  97.   	{
  98.   	return(X509v3_get_ext(x->tbsRequest->requestExtensions,loc));
  99.   	}
          ^
  100.   
  101.   X509_EXTENSION *OCSP_REQUEST_delete_ext(OCSP_REQUEST *x, int loc)

crypto/ocsp/ocsp_ext.c:363:2: 
361.   		}
362.   	req_ext = OCSP_REQUEST_get_ext(req, req_idx);
363. > 	resp_ext = OCSP_BASICRESP_get_ext(bs, resp_idx);
364.   	if(ASN1_OCTET_STRING_cmp(req_ext->value, resp_ext->value))
365.   		{

crypto/ocsp/ocsp_ext.c:192:1: start of procedure OCSP_BASICRESP_get_ext()
  190.   	}
  191.   
  192. > X509_EXTENSION *OCSP_BASICRESP_get_ext(OCSP_BASICRESP *x, int loc)
  193.   	{
  194.   	return(X509v3_get_ext(x->tbsResponseData->responseExtensions,loc));

crypto/ocsp/ocsp_ext.c:194:2: 
  192.   X509_EXTENSION *OCSP_BASICRESP_get_ext(OCSP_BASICRESP *x, int loc)
  193.   	{
  194. > 	return(X509v3_get_ext(x->tbsResponseData->responseExtensions,loc));
  195.   	}
  196.   

crypto/x509/x509_v3.c:125:1: start of procedure X509v3_get_ext()
    123.   	}
    124.   
    125. > X509_EXTENSION *X509v3_get_ext(const STACK_OF(X509_EXTENSION) *x, int loc)
    126.   	{
    127.   	if (x == NULL || sk_X509_EXTENSION_num(x) <= loc || loc < 0)

crypto/x509/x509_v3.c:127:6: Taking false branch
    125.   X509_EXTENSION *X509v3_get_ext(const STACK_OF(X509_EXTENSION) *x, int loc)
    126.   	{
    127.   	if (x == NULL || sk_X509_EXTENSION_num(x) <= loc || loc < 0)
                ^
    128.   		return NULL;
    129.   	else

crypto/x509/x509_v3.c:127:19: 
    125.   X509_EXTENSION *X509v3_get_ext(const STACK_OF(X509_EXTENSION) *x, int loc)
    126.   	{
    127. > 	if (x == NULL || sk_X509_EXTENSION_num(x) <= loc || loc < 0)
    128.   		return NULL;
    129.   	else

crypto/stack/stack.c:299:1: start of procedure sk_num()
      297.   	}
      298.   
      299. > int sk_num(const STACK *st)
      300.   {
      301.   	if(st == NULL) return -1;

crypto/stack/stack.c:301:5: Taking false branch
      299.   int sk_num(const STACK *st)
      300.   {
      301.   	if(st == NULL) return -1;
                 ^
      302.   	return st->num;
      303.   }

crypto/stack/stack.c:302:2: 
      300.   {
      301.   	if(st == NULL) return -1;
      302. > 	return st->num;
      303.   }
      304.   

crypto/stack/stack.c:303:1: return from a call to sk_num
      301.   	if(st == NULL) return -1;
      302.   	return st->num;
      303. > }
      304.   
      305.   char *sk_value(const STACK *st, int i)

crypto/x509/x509_v3.c:127:19: Taking false branch
    125.   X509_EXTENSION *X509v3_get_ext(const STACK_OF(X509_EXTENSION) *x, int loc)
    126.   	{
    127.   	if (x == NULL || sk_X509_EXTENSION_num(x) <= loc || loc < 0)
                             ^
    128.   		return NULL;
    129.   	else

crypto/x509/x509_v3.c:127:54: Taking true branch
    125.   X509_EXTENSION *X509v3_get_ext(const STACK_OF(X509_EXTENSION) *x, int loc)
    126.   	{
    127.   	if (x == NULL || sk_X509_EXTENSION_num(x) <= loc || loc < 0)
                                                                ^
    128.   		return NULL;
    129.   	else

crypto/x509/x509_v3.c:128:3: 
    126.   	{
    127.   	if (x == NULL || sk_X509_EXTENSION_num(x) <= loc || loc < 0)
    128. > 		return NULL;
    129.   	else
    130.   		return sk_X509_EXTENSION_value(x,loc);

crypto/x509/x509_v3.c:131:2: return from a call to X509v3_get_ext
    129.   	else
    130.   		return sk_X509_EXTENSION_value(x,loc);
    131.   	}
            ^
    132.   
    133.   X509_EXTENSION *X509v3_delete_ext(STACK_OF(X509_EXTENSION) *x, int loc)

crypto/ocsp/ocsp_ext.c:195:2: return from a call to OCSP_BASICRESP_get_ext
  193.   	{
  194.   	return(X509v3_get_ext(x->tbsResponseData->responseExtensions,loc));
  195.   	}
          ^
  196.   
  197.   X509_EXTENSION *OCSP_BASICRESP_delete_ext(OCSP_BASICRESP *x, int loc)

crypto/ocsp/ocsp_ext.c:364:5: 
362.   	req_ext = OCSP_REQUEST_get_ext(req, req_idx);
363.   	resp_ext = OCSP_BASICRESP_get_ext(bs, resp_idx);
364. > 	if(ASN1_OCTET_STRING_cmp(req_ext->value, resp_ext->value))
365.   		{
366.   		OCSPerr(OCSP_F_OCSP_CHECK_NONCE, OCSP_R_NONCE_VALUE_MISMATCH);
