crypto/x509/x509_vfy.c:1366: error: NULL_DEREFERENCE
  pointer `xs` last assigned on line 1358 could be null and is dereferenced at line 1366, column 8.
Showing all 35 steps of the trace


crypto/x509/x509_vfy.c:1329:1: start of procedure internal_verify()
1327.   	}
1328.   
1329. > static int internal_verify(X509_STORE_CTX *ctx)
1330.   	{
1331.   	int ok=0,n;

crypto/x509/x509_vfy.c:1331:2: 
1329.   static int internal_verify(X509_STORE_CTX *ctx)
1330.   	{
1331. > 	int ok=0,n;
1332.   	X509 *xs,*xi;
1333.   	EVP_PKEY *pkey=NULL;

crypto/x509/x509_vfy.c:1333:2: 
1331.   	int ok=0,n;
1332.   	X509 *xs,*xi;
1333. > 	EVP_PKEY *pkey=NULL;
1334.   	int (*cb)(int xok,X509_STORE_CTX *xctx);
1335.   

crypto/x509/x509_vfy.c:1336:2: 
1334.   	int (*cb)(int xok,X509_STORE_CTX *xctx);
1335.   
1336. > 	cb=ctx->verify_cb;
1337.   
1338.   	n=sk_X509_num(ctx->chain);

crypto/x509/x509_vfy.c:1338:4: Condition is true
1336.   	cb=ctx->verify_cb;
1337.   
1338.   	n=sk_X509_num(ctx->chain);
           ^
1339.   	ctx->error_depth=n-1;
1340.   	n--;

crypto/x509/x509_vfy.c:1338:2: 
1336.   	cb=ctx->verify_cb;
1337.   
1338. > 	n=sk_X509_num(ctx->chain);
1339.   	ctx->error_depth=n-1;
1340.   	n--;

crypto/stack/stack.c:302:1: start of procedure sk_num()
  300.   	}
  301.   
  302. > int sk_num(const _STACK *st)
  303.   {
  304.   	if(st == NULL) return -1;

crypto/stack/stack.c:304:5: Taking false branch
  302.   int sk_num(const _STACK *st)
  303.   {
  304.   	if(st == NULL) return -1;
             ^
  305.   	return st->num;
  306.   }

crypto/stack/stack.c:305:2: 
  303.   {
  304.   	if(st == NULL) return -1;
  305. > 	return st->num;
  306.   }
  307.   

crypto/stack/stack.c:306:1: return from a call to sk_num
  304.   	if(st == NULL) return -1;
  305.   	return st->num;
  306. > }
  307.   
  308.   void *sk_value(const _STACK *st, int i)

crypto/x509/x509_vfy.c:1339:2: 
1337.   
1338.   	n=sk_X509_num(ctx->chain);
1339. > 	ctx->error_depth=n-1;
1340.   	n--;
1341.   	xi=sk_X509_value(ctx->chain,n);

crypto/x509/x509_vfy.c:1340:2: 
1338.   	n=sk_X509_num(ctx->chain);
1339.   	ctx->error_depth=n-1;
1340. > 	n--;
1341.   	xi=sk_X509_value(ctx->chain,n);
1342.   

crypto/x509/x509_vfy.c:1341:5: Condition is true
1339.   	ctx->error_depth=n-1;
1340.   	n--;
1341.   	xi=sk_X509_value(ctx->chain,n);
            ^
1342.   
1343.   	if (ctx->check_issued(ctx, xi, xi))

crypto/x509/x509_vfy.c:1341:2: 
1339.   	ctx->error_depth=n-1;
1340.   	n--;
1341. > 	xi=sk_X509_value(ctx->chain,n);
1342.   
1343.   	if (ctx->check_issued(ctx, xi, xi))

crypto/stack/stack.c:308:1: start of procedure sk_value()
  306.   }
  307.   
  308. > void *sk_value(const _STACK *st, int i)
  309.   {
  310.   	if(!st || (i < 0) || (i >= st->num)) return NULL;

crypto/stack/stack.c:310:6: Taking false branch
  308.   void *sk_value(const _STACK *st, int i)
  309.   {
  310.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
              ^
  311.   	return st->data[i];
  312.   }

crypto/stack/stack.c:310:13: Taking false branch
  308.   void *sk_value(const _STACK *st, int i)
  309.   {
  310.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
                     ^
  311.   	return st->data[i];
  312.   }

crypto/stack/stack.c:310:24: Taking false branch
  308.   void *sk_value(const _STACK *st, int i)
  309.   {
  310.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
                                ^
  311.   	return st->data[i];
  312.   }

crypto/stack/stack.c:311:2: 
  309.   {
  310.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
  311. > 	return st->data[i];
  312.   }
  313.   

crypto/stack/stack.c:312:1: return from a call to sk_value
  310.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
  311.   	return st->data[i];
  312. > }
  313.   
  314.   void *sk_set(_STACK *st, int i, void *value)

crypto/x509/x509_vfy.c:1343:6: Taking false branch
1341.   	xi=sk_X509_value(ctx->chain,n);
1342.   
1343.   	if (ctx->check_issued(ctx, xi, xi))
             ^
1344.   		xs=xi;
1345.   	else

crypto/x509/x509_vfy.c:1347:7: Taking false branch
1345.   	else
1346.   		{
1347.   		if (n <= 0)
              ^
1348.   			{
1349.   			ctx->error=X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE;

crypto/x509/x509_vfy.c:1356:4: 
1354.   		else
1355.   			{
1356. > 			n--;
1357.   			ctx->error_depth=n;
1358.   			xs=sk_X509_value(ctx->chain,n);

crypto/x509/x509_vfy.c:1357:4: 
1355.   			{
1356.   			n--;
1357. > 			ctx->error_depth=n;
1358.   			xs=sk_X509_value(ctx->chain,n);
1359.   			}

crypto/x509/x509_vfy.c:1358:7: Condition is true
1356.   			n--;
1357.   			ctx->error_depth=n;
1358.   			xs=sk_X509_value(ctx->chain,n);
              ^
1359.   			}
1360.   		}

crypto/x509/x509_vfy.c:1358:4: 
1356.   			n--;
1357.   			ctx->error_depth=n;
1358. > 			xs=sk_X509_value(ctx->chain,n);
1359.   			}
1360.   		}

crypto/stack/stack.c:308:1: start of procedure sk_value()
  306.   }
  307.   
  308. > void *sk_value(const _STACK *st, int i)
  309.   {
  310.   	if(!st || (i < 0) || (i >= st->num)) return NULL;

crypto/stack/stack.c:310:6: Taking false branch
  308.   void *sk_value(const _STACK *st, int i)
  309.   {
  310.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
              ^
  311.   	return st->data[i];
  312.   }

crypto/stack/stack.c:310:13: Taking false branch
  308.   void *sk_value(const _STACK *st, int i)
  309.   {
  310.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
                     ^
  311.   	return st->data[i];
  312.   }

crypto/stack/stack.c:310:24: Taking true branch
  308.   void *sk_value(const _STACK *st, int i)
  309.   {
  310.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
                                ^
  311.   	return st->data[i];
  312.   }

crypto/stack/stack.c:310:39: 
  308.   void *sk_value(const _STACK *st, int i)
  309.   {
  310. > 	if(!st || (i < 0) || (i >= st->num)) return NULL;
  311.   	return st->data[i];
  312.   }

crypto/stack/stack.c:312:1: return from a call to sk_value
  310.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
  311.   	return st->data[i];
  312. > }
  313.   
  314.   void *sk_set(_STACK *st, int i, void *value)

crypto/x509/x509_vfy.c:1363:9: Loop condition is true. Entering loop body
1361.   
1362.   /*	ctx->error=0;  not needed */
1363.   	while (n >= 0)
                ^
1364.   		{
1365.   		ctx->error_depth=n;

crypto/x509/x509_vfy.c:1365:3: 
1363.   	while (n >= 0)
1364.   		{
1365. > 		ctx->error_depth=n;
1366.   		if (!xs->valid)
1367.   			{

crypto/x509/x509_vfy.c:1366:8: Taking false branch
1364.   		{
1365.   		ctx->error_depth=n;
1366.   		if (!xs->valid)
               ^
1367.   			{
1368.   			if ((pkey=X509_get_pubkey(xi)) == NULL)
