crypto/x509/x509_vfy.c:332: error: NULL_DEREFERENCE
  pointer `null` is dereferenced by call to `X509_get_pubkey_parameters()` at line 332, column 3.
Showing all 62 steps of the trace


crypto/x509/x509_vfy.c:99:1: start of procedure X509_verify_cert()
97.   #endif
98.   
99. > int X509_verify_cert(X509_STORE_CTX *ctx)
100.   	{
101.   	X509 *x,*xtmp,*chain_ss=NULL;

crypto/x509/x509_vfy.c:101:2: 
99.   int X509_verify_cert(X509_STORE_CTX *ctx)
100.   	{
101. > 	X509 *x,*xtmp,*chain_ss=NULL;
102.   	X509_NAME *xn;
103.   	int bad_chain = 0;

crypto/x509/x509_vfy.c:103:2: 
101.   	X509 *x,*xtmp,*chain_ss=NULL;
102.   	X509_NAME *xn;
103. > 	int bad_chain = 0;
104.   	X509_VERIFY_PARAM *param = ctx->param;
105.   	int depth,i,ok=0;

crypto/x509/x509_vfy.c:104:2: 
102.   	X509_NAME *xn;
103.   	int bad_chain = 0;
104. > 	X509_VERIFY_PARAM *param = ctx->param;
105.   	int depth,i,ok=0;
106.   	int num;

crypto/x509/x509_vfy.c:105:2: 
103.   	int bad_chain = 0;
104.   	X509_VERIFY_PARAM *param = ctx->param;
105. > 	int depth,i,ok=0;
106.   	int num;
107.   	int (*cb)(int xok,X509_STORE_CTX *xctx);

crypto/x509/x509_vfy.c:108:2: 
106.   	int num;
107.   	int (*cb)(int xok,X509_STORE_CTX *xctx);
108. > 	STACK_OF(X509) *sktmp=NULL;
109.   	if (ctx->cert == NULL)
110.   		{

crypto/x509/x509_vfy.c:109:6: Taking false branch
107.   	int (*cb)(int xok,X509_STORE_CTX *xctx);
108.   	STACK_OF(X509) *sktmp=NULL;
109.   	if (ctx->cert == NULL)
            ^
110.   		{
111.   		X509err(X509_F_X509_VERIFY_CERT,X509_R_NO_CERT_SET_FOR_US_TO_VERIFY);

crypto/x509/x509_vfy.c:115:2: 
113.   		}
114.   
115. > 	cb=ctx->verify_cb;
116.   
117.   	/* first we make sure the chain we are going to build is

crypto/x509/x509_vfy.c:119:6: Taking false branch
117.   	/* first we make sure the chain we are going to build is
118.   	 * present and that the first entry is in place */
119.   	if (ctx->chain == NULL)
            ^
120.   		{
121.   		if (	((ctx->chain=sk_X509_new_null()) == NULL) ||

crypto/x509/x509_vfy.c:132:6: Taking true branch
130.   
131.   	/* We use a temporary STACK so we can chop and hack at it */
132.   	if (ctx->untrusted != NULL
            ^
133.   	    && (sktmp=sk_X509_dup(ctx->untrusted)) == NULL)
134.   		{

crypto/x509/x509_vfy.c:133:9: 
131.   	/* We use a temporary STACK so we can chop and hack at it */
132.   	if (ctx->untrusted != NULL
133. > 	    && (sktmp=sk_X509_dup(ctx->untrusted)) == NULL)
134.   		{
135.   		X509err(X509_F_X509_VERIFY_CERT,ERR_R_MALLOC_FAILURE);

crypto/x509/x509.h:304:1: start of procedure sk_X509_dup()
  302.   	} /* X509 */;
  303.   
  304. > DECLARE_STACK_OF(X509)
  305.   DECLARE_ASN1_SET_OF(X509)
  306.   

crypto/stack/stack.c:92:1: start of procedure sk_dup()
    90.   	}
    91.   
    92. > STACK *sk_dup(STACK *sk)
    93.   	{
    94.   	STACK *ret;

crypto/stack/stack.c:97:6: 
    95.   	char **s;
    96.   
    97. > 	if ((ret=sk_new(sk->comp)) == NULL) goto err;
    98.   	s=(char **)OPENSSL_realloc((char *)ret->data,
    99.   		(unsigned int)sizeof(char *)*sk->num_alloc);

crypto/stack/stack.c:120:1: start of procedure sk_new()
      118.   	}
      119.   
      120. > STACK *sk_new(int (*c)(const char * const *, const char * const *))
      121.   	{
      122.   	STACK *ret;

crypto/stack/stack.c:125:6: 
      123.   	int i;
      124.   
      125. > 	if ((ret=(STACK *)OPENSSL_malloc(sizeof(STACK))) == NULL)
      126.   		goto err;
      127.   	if ((ret->data=(char **)OPENSSL_malloc(sizeof(char *)*MIN_NODES)) == NULL)

crypto/mem.c:294:1: start of procedure CRYPTO_malloc()
        292.   	}
        293.   
        294. > void *CRYPTO_malloc(int num, const char *file, int line)
        295.   	{
        296.   	void *ret = NULL;

crypto/mem.c:296:2: 
        294.   void *CRYPTO_malloc(int num, const char *file, int line)
        295.   	{
        296. > 	void *ret = NULL;
        297.   
        298.   	if (num <= 0) return NULL;

crypto/mem.c:298:6: Taking false branch
        296.   	void *ret = NULL;
        297.   
        298.   	if (num <= 0) return NULL;
                    ^
        299.   
        300.   	allow_customize = 0;

crypto/mem.c:300:2: 
        298.   	if (num <= 0) return NULL;
        299.   
        300. > 	allow_customize = 0;
        301.   	if (malloc_debug_func != NULL)
        302.   		{

crypto/mem.c:301:6: Taking true branch
        299.   
        300.   	allow_customize = 0;
        301.   	if (malloc_debug_func != NULL)
                    ^
        302.   		{
        303.   		allow_customize_debug = 0;

crypto/mem.c:303:3: 
        301.   	if (malloc_debug_func != NULL)
        302.   		{
        303. > 		allow_customize_debug = 0;
        304.   		malloc_debug_func(NULL, num, file, line, 0);
        305.   		}

crypto/mem.c:304:3: Skipping __function_pointer__(): unresolved function pointer
        302.   		{
        303.   		allow_customize_debug = 0;
        304.   		malloc_debug_func(NULL, num, file, line, 0);
                 ^
        305.   		}
        306.   	ret = malloc_ex_func(num,file,line);

crypto/mem.c:306:2: Skipping __function_pointer__(): unresolved function pointer
        304.   		malloc_debug_func(NULL, num, file, line, 0);
        305.   		}
        306.   	ret = malloc_ex_func(num,file,line);
                ^
        307.   #ifdef LEVITTE_DEBUG_MEM
        308.   	fprintf(stderr, "LEVITTE_DEBUG_MEM:         > 0x%p (%d)\n", ret, num);

crypto/mem.c:310:6: Taking true branch
        308.   	fprintf(stderr, "LEVITTE_DEBUG_MEM:         > 0x%p (%d)\n", ret, num);
        309.   #endif
        310.   	if (malloc_debug_func != NULL)
                    ^
        311.   		malloc_debug_func(ret, num, file, line, 1);
        312.   

crypto/mem.c:311:3: Skipping __function_pointer__(): unresolved function pointer
        309.   #endif
        310.   	if (malloc_debug_func != NULL)
        311.   		malloc_debug_func(ret, num, file, line, 1);
                 ^
        312.   
        313.   #ifndef OPENSSL_CPUID_OBJ

crypto/mem.c:317:12: Taking false branch
        315.            * sanitisation function can't be optimised out. NB: We only do
        316.            * this for >2Kb so the overhead doesn't bother us. */
        317.           if(ret && (num > 2048))
                          ^
        318.   	{	extern unsigned char cleanse_ctr;
        319.                   ((unsigned char *)ret)[0] = cleanse_ctr;

crypto/mem.c:323:2: 
        321.   #endif
        322.   
        323. > 	return ret;
        324.   	}
        325.   

crypto/mem.c:324:2: return from a call to CRYPTO_malloc
        322.   
        323.   	return ret;
        324.   	}
                ^
        325.   
        326.   void *CRYPTO_realloc(void *str, int num, const char *file, int line)

crypto/stack/stack.c:125:6: Taking true branch
      123.   	int i;
      124.   
      125.   	if ((ret=(STACK *)OPENSSL_malloc(sizeof(STACK))) == NULL)
                  ^
      126.   		goto err;
      127.   	if ((ret->data=(char **)OPENSSL_malloc(sizeof(char *)*MIN_NODES)) == NULL)

crypto/stack/stack.c:136:1: 
      134.   	ret->sorted=0;
      135.   	return(ret);
      136. > err:
      137.   	if(ret)
      138.   		OPENSSL_free(ret);

crypto/stack/stack.c:137:5: Taking false branch
      135.   	return(ret);
      136.   err:
      137.   	if(ret)
                 ^
      138.   		OPENSSL_free(ret);
      139.   	return(NULL);

crypto/stack/stack.c:139:2: 
      137.   	if(ret)
      138.   		OPENSSL_free(ret);
      139. > 	return(NULL);
      140.   	}
      141.   

crypto/stack/stack.c:140:2: return from a call to sk_new
      138.   		OPENSSL_free(ret);
      139.   	return(NULL);
      140.   	}
              ^
      141.   
      142.   int sk_insert(STACK *st, char *data, int loc)

crypto/stack/stack.c:97:6: Taking true branch
    95.   	char **s;
    96.   
    97.   	if ((ret=sk_new(sk->comp)) == NULL) goto err;
                ^
    98.   	s=(char **)OPENSSL_realloc((char *)ret->data,
    99.   		(unsigned int)sizeof(char *)*sk->num_alloc);

crypto/stack/stack.c:109:1: 
    107.   	ret->comp=sk->comp;
    108.   	return(ret);
    109. > err:
    110.   	if(ret)
    111.   		sk_free(ret);

crypto/stack/stack.c:110:5: Taking false branch
    108.   	return(ret);
    109.   err:
    110.   	if(ret)
               ^
    111.   		sk_free(ret);
    112.   	return(NULL);

crypto/stack/stack.c:112:2: 
    110.   	if(ret)
    111.   		sk_free(ret);
    112. > 	return(NULL);
    113.   	}
    114.   

crypto/stack/stack.c:113:2: return from a call to sk_dup
    111.   		sk_free(ret);
    112.   	return(NULL);
    113.   	}
            ^
    114.   
    115.   STACK *sk_new_null(void)

crypto/x509/x509.h:304:1: return from a call to sk_X509_dup
  302.   	} /* X509 */;
  303.   
  304. > DECLARE_STACK_OF(X509)
  305.   DECLARE_ASN1_SET_OF(X509)
  306.   

crypto/x509/x509_vfy.c:133:9: Taking true branch
131.   	/* We use a temporary STACK so we can chop and hack at it */
132.   	if (ctx->untrusted != NULL
133.   	    && (sktmp=sk_X509_dup(ctx->untrusted)) == NULL)
               ^
134.   		{
135.   		X509err(X509_F_X509_VERIFY_CERT,ERR_R_MALLOC_FAILURE);

crypto/x509/x509_vfy.c:135:3: 
133.   	    && (sktmp=sk_X509_dup(ctx->untrusted)) == NULL)
134.   		{
135. > 		X509err(X509_F_X509_VERIFY_CERT,ERR_R_MALLOC_FAILURE);
136.   		goto end;
137.   		}

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

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

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

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

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

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

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

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

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

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

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

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

crypto/x509/x509_vfy.c:331:1: 
329.   	if (0)
330.   		{
331. > end:
332.   		X509_get_pubkey_parameters(NULL,ctx->chain);
333.   		}

crypto/x509/x509_vfy.c:332:3: 
330.   		{
331.   end:
332. > 		X509_get_pubkey_parameters(NULL,ctx->chain);
333.   		}
334.   	if (sktmp != NULL) sk_X509_free(sktmp);

crypto/x509/x509_vfy.c:1263:1: start of procedure X509_get_pubkey_parameters()
  1261.   	}
  1262.   
  1263. > int X509_get_pubkey_parameters(EVP_PKEY *pkey, STACK_OF(X509) *chain)
  1264.   	{
  1265.   	EVP_PKEY *ktmp=NULL,*ktmp2;

crypto/x509/x509_vfy.c:1265:2: 
  1263.   int X509_get_pubkey_parameters(EVP_PKEY *pkey, STACK_OF(X509) *chain)
  1264.   	{
  1265. > 	EVP_PKEY *ktmp=NULL,*ktmp2;
  1266.   	int i,j;
  1267.   

crypto/x509/x509_vfy.c:1268:7: Taking true branch
  1266.   	int i,j;
  1267.   
  1268.   	if ((pkey != NULL) && !EVP_PKEY_missing_parameters(pkey)) return 1;
                ^
  1269.   
  1270.   	for (i=0; i<sk_X509_num(chain); i++)

crypto/x509/x509_vfy.c:1268:25: 
  1266.   	int i,j;
  1267.   
  1268. > 	if ((pkey != NULL) && !EVP_PKEY_missing_parameters(pkey)) return 1;
  1269.   
  1270.   	for (i=0; i<sk_X509_num(chain); i++)

crypto/evp/p_lib.c:143:1: start of procedure EVP_PKEY_missing_parameters()
    141.   	}
    142.   
    143. > int EVP_PKEY_missing_parameters(const EVP_PKEY *pkey)
    144.   	{
    145.   	if (pkey->ameth && pkey->ameth->param_missing)

crypto/evp/p_lib.c:145:6: Taking false branch
    143.   int EVP_PKEY_missing_parameters(const EVP_PKEY *pkey)
    144.   	{
    145.   	if (pkey->ameth && pkey->ameth->param_missing)
                ^
    146.   		return pkey->ameth->param_missing(pkey);
    147.   	return 0;
