crypto/x509/x509_vfy.c:307: error: NULL_DEREFERENCE
  pointer `xi` last assigned on line 306 could be null and is dereferenced by call to `X509_get_subject_name()` at line 307, column 20.
Showing all 20 steps of the trace


crypto/x509/x509_vfy.c:293:1: start of procedure internal_verify()
291.   	}
292.   
293. > static int internal_verify(X509_STORE_CTX *ctx)
294.   	{
295.   	int i,ok=0,n;

crypto/x509/x509_vfy.c:295:2: 
293.   static int internal_verify(X509_STORE_CTX *ctx)
294.   	{
295. > 	int i,ok=0,n;
296.   	X509 *xs,*xi;
297.   	EVP_PKEY *pkey=NULL;

crypto/x509/x509_vfy.c:297:2: 
295.   	int i,ok=0,n;
296.   	X509 *xs,*xi;
297. > 	EVP_PKEY *pkey=NULL;
298.   	int (*cb)();
299.   

crypto/x509/x509_vfy.c:300:2: 
298.   	int (*cb)();
299.   
300. > 	cb=ctx->ctx->verify_cb;
301.   	if (cb == NULL) cb=null_callback;
302.   

crypto/x509/x509_vfy.c:301:6: Taking false branch
299.   
300.   	cb=ctx->ctx->verify_cb;
301.   	if (cb == NULL) cb=null_callback;
            ^
302.   
303.   	n=sk_num(ctx->chain);

crypto/x509/x509_vfy.c:303:2: 
301.   	if (cb == NULL) cb=null_callback;
302.   
303. > 	n=sk_num(ctx->chain);
304.   	ctx->error_depth=n-1;
305.   	n--;

crypto/stack/stack.c:287:1: start of procedure sk_num()
  285.   	}
  286.   
  287. > int sk_num(STACK *st)
  288.   {
  289.   	if(st == NULL) return -1;

crypto/stack/stack.c:289:5: Taking true branch
  287.   int sk_num(STACK *st)
  288.   {
  289.   	if(st == NULL) return -1;
             ^
  290.   	return st->num;
  291.   }

crypto/stack/stack.c:289:17: 
  287.   int sk_num(STACK *st)
  288.   {
  289. > 	if(st == NULL) return -1;
  290.   	return st->num;
  291.   }

crypto/stack/stack.c:291:1: return from a call to sk_num
  289.   	if(st == NULL) return -1;
  290.   	return st->num;
  291. > }
  292.   
  293.   char *sk_value(STACK *st, int i)

crypto/x509/x509_vfy.c:304:2: 
302.   
303.   	n=sk_num(ctx->chain);
304. > 	ctx->error_depth=n-1;
305.   	n--;
306.   	xi=(X509 *)sk_value(ctx->chain,n);

crypto/x509/x509_vfy.c:305:2: 
303.   	n=sk_num(ctx->chain);
304.   	ctx->error_depth=n-1;
305. > 	n--;
306.   	xi=(X509 *)sk_value(ctx->chain,n);
307.   	if (X509_NAME_cmp(X509_get_subject_name(xi),

crypto/x509/x509_vfy.c:306:2: 
304.   	ctx->error_depth=n-1;
305.   	n--;
306. > 	xi=(X509 *)sk_value(ctx->chain,n);
307.   	if (X509_NAME_cmp(X509_get_subject_name(xi),
308.   		X509_get_issuer_name(xi)) == 0)

crypto/stack/stack.c:293:1: start of procedure sk_value()
  291.   }
  292.   
  293. > char *sk_value(STACK *st, int i)
  294.   {
  295.   	if(st == NULL) return NULL;

crypto/stack/stack.c:295:5: Taking true branch
  293.   char *sk_value(STACK *st, int i)
  294.   {
  295.   	if(st == NULL) return NULL;
             ^
  296.   	return st->data[i];
  297.   }

crypto/stack/stack.c:295:17: 
  293.   char *sk_value(STACK *st, int i)
  294.   {
  295. > 	if(st == NULL) return NULL;
  296.   	return st->data[i];
  297.   }

crypto/stack/stack.c:297:1: return from a call to sk_value
  295.   	if(st == NULL) return NULL;
  296.   	return st->data[i];
  297. > }
  298.   
  299.   char *sk_set(STACK *st, int i, char *value)

crypto/x509/x509_vfy.c:307:6: 
305.   	n--;
306.   	xi=(X509 *)sk_value(ctx->chain,n);
307. > 	if (X509_NAME_cmp(X509_get_subject_name(xi),
308.   		X509_get_issuer_name(xi)) == 0)
309.   		xs=xi;

crypto/x509/x509_cmp.c:126:1: start of procedure X509_get_subject_name()
  124.   	}
  125.   
  126. > X509_NAME *X509_get_subject_name(X509 *a)
  127.   	{
  128.   	return(a->cert_info->subject);

crypto/x509/x509_cmp.c:128:2: 
  126.   X509_NAME *X509_get_subject_name(X509 *a)
  127.   	{
  128. > 	return(a->cert_info->subject);
  129.   	}
  130.   
