crypto/x509/x509_lu.c:660: error: NULL_DEREFERENCE
  pointer `pobj` last assigned on line 658 could be null and is dereferenced at line 660, column 7.
Showing all 35 steps of the trace


crypto/x509/x509_lu.c:620:1: start of procedure X509_STORE_CTX_get1_issuer()
618.   
619.   
620. > int X509_STORE_CTX_get1_issuer(X509 **issuer, X509_STORE_CTX *ctx, X509 *x)
621.   {
622.   	X509_NAME *xn;

crypto/x509/x509_lu.c:625:2: 
623.   	X509_OBJECT obj, *pobj;
624.   	int i, ok, idx;
625. > 	xn=X509_get_issuer_name(x);
626.   	ok=X509_STORE_get_by_subject(ctx,X509_LU_X509,xn,&obj);
627.   	if (ok != X509_LU_X509)

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

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

crypto/x509/x509_cmp.c:129:2: return from a call to X509_get_issuer_name
  127.   	{
  128.   	return(a->cert_info->issuer);
  129.   	}
          ^
  130.   
  131.   unsigned long X509_issuer_name_hash(X509 *x)

crypto/x509/x509_lu.c:626:2: Skipping X509_STORE_get_by_subject(): empty list of specs
624.   	int i, ok, idx;
625.   	xn=X509_get_issuer_name(x);
626.   	ok=X509_STORE_get_by_subject(ctx,X509_LU_X509,xn,&obj);
        ^
627.   	if (ok != X509_LU_X509)
628.   		{

crypto/x509/x509_lu.c:627:6: Taking false branch
625.   	xn=X509_get_issuer_name(x);
626.   	ok=X509_STORE_get_by_subject(ctx,X509_LU_X509,xn,&obj);
627.   	if (ok != X509_LU_X509)
            ^
628.   		{
629.   		if (ok == X509_LU_RETRY)

crypto/x509/x509_lu.c:644:6: Taking false branch
642.   		}
643.   	/* If certificate matches all OK */
644.   	if (ctx->check_issued(ctx, x, obj.data.x509))
            ^
645.   		{
646.   		*issuer = obj.data.x509;

crypto/x509/x509_lu.c:649:2: 
647.   		return 1;
648.   		}
649. > 	X509_OBJECT_free_contents(&obj);
650.   	/* Else find index of first matching cert */
651.   	idx = X509_OBJECT_idx_by_subject(ctx->ctx->objs, X509_LU_X509, xn);

crypto/x509/x509_lu.c:406:1: start of procedure X509_OBJECT_free_contents()
  404.   	}
  405.   
  406. > void X509_OBJECT_free_contents(X509_OBJECT *a)
  407.   	{
  408.   	switch (a->type)

crypto/x509/x509_lu.c:408:2: 
  406.   void X509_OBJECT_free_contents(X509_OBJECT *a)
  407.   	{
  408. > 	switch (a->type)
  409.   		{
  410.   	case X509_LU_X509:

crypto/x509/x509_lu.c:410:2: Switch condition is false. Skipping switch case
  408.   	switch (a->type)
  409.   		{
  410.   	case X509_LU_X509:
          ^
  411.   		X509_free(a->data.x509);
  412.   		break;

crypto/x509/x509_lu.c:413:2: Switch condition is false. Skipping switch case
  411.   		X509_free(a->data.x509);
  412.   		break;
  413.   	case X509_LU_CRL:
          ^
  414.   		X509_CRL_free(a->data.crl);
  415.   		break;

crypto/x509/x509_lu.c:417:2: return from a call to X509_OBJECT_free_contents
  415.   		break;
  416.   		}
  417.   	}
          ^
  418.   
  419.   static int x509_object_idx_cnt(STACK_OF(X509_OBJECT) *h, int type,

crypto/x509/x509_lu.c:651:2: 
649.   	X509_OBJECT_free_contents(&obj);
650.   	/* Else find index of first matching cert */
651. > 	idx = X509_OBJECT_idx_by_subject(ctx->ctx->objs, X509_LU_X509, xn);
652.   	/* This shouldn't normally happen since we already have one match */
653.   	if (idx == -1) return 0;

crypto/x509/x509_lu.c:466:1: start of procedure X509_OBJECT_idx_by_subject()
  464.   
  465.   
  466. > int X509_OBJECT_idx_by_subject(STACK_OF(X509_OBJECT) *h, int type,
  467.   	     X509_NAME *name)
  468.   	{

crypto/x509/x509_lu.c:469:2: Skipping x509_object_idx_cnt(): empty list of specs
  467.   	     X509_NAME *name)
  468.   	{
  469.   	return x509_object_idx_cnt(h, type, name, NULL);
          ^
  470.   	}
  471.   

crypto/x509/x509_lu.c:470:2: return from a call to X509_OBJECT_idx_by_subject
  468.   	{
  469.   	return x509_object_idx_cnt(h, type, name, NULL);
  470.   	}
          ^
  471.   
  472.   X509_OBJECT *X509_OBJECT_retrieve_by_subject(STACK_OF(X509_OBJECT) *h, int type,

crypto/x509/x509_lu.c:653:6: Taking false branch
651.   	idx = X509_OBJECT_idx_by_subject(ctx->ctx->objs, X509_LU_X509, xn);
652.   	/* This shouldn't normally happen since we already have one match */
653.   	if (idx == -1) return 0;
            ^
654.   
655.   	/* Look through all matching certificates for a suitable issuer */

crypto/x509/x509_lu.c:656:7: 
654.   
655.   	/* Look through all matching certificates for a suitable issuer */
656. > 	for (i = idx; i < sk_X509_OBJECT_num(ctx->ctx->objs); i++)
657.   		{
658.   		pobj = sk_X509_OBJECT_value(ctx->ctx->objs, i);

crypto/x509/x509_lu.c:656:20: Condition is true
654.   
655.   	/* Look through all matching certificates for a suitable issuer */
656.   	for (i = idx; i < sk_X509_OBJECT_num(ctx->ctx->objs); i++)
                          ^
657.   		{
658.   		pobj = sk_X509_OBJECT_value(ctx->ctx->objs, i);

crypto/x509/x509_lu.c:656:16: 
654.   
655.   	/* Look through all matching certificates for a suitable issuer */
656. > 	for (i = idx; i < sk_X509_OBJECT_num(ctx->ctx->objs); i++)
657.   		{
658.   		pobj = sk_X509_OBJECT_value(ctx->ctx->objs, i);

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_lu.c:656:16: Loop condition is true. Entering loop body
654.   
655.   	/* Look through all matching certificates for a suitable issuer */
656.   	for (i = idx; i < sk_X509_OBJECT_num(ctx->ctx->objs); i++)
                      ^
657.   		{
658.   		pobj = sk_X509_OBJECT_value(ctx->ctx->objs, i);

crypto/x509/x509_lu.c:658:10: Condition is true
656.   	for (i = idx; i < sk_X509_OBJECT_num(ctx->ctx->objs); i++)
657.   		{
658.   		pobj = sk_X509_OBJECT_value(ctx->ctx->objs, i);
                ^
659.   		/* See if we've ran out of matches */
660.   		if (pobj->type != X509_LU_X509) return 0;

crypto/x509/x509_lu.c:658:3: 
656.   	for (i = idx; i < sk_X509_OBJECT_num(ctx->ctx->objs); i++)
657.   		{
658. > 		pobj = sk_X509_OBJECT_value(ctx->ctx->objs, i);
659.   		/* See if we've ran out of matches */
660.   		if (pobj->type != X509_LU_X509) return 0;

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 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_lu.c:660:7: 
658.   		pobj = sk_X509_OBJECT_value(ctx->ctx->objs, i);
659.   		/* See if we've ran out of matches */
660. > 		if (pobj->type != X509_LU_X509) return 0;
661.   		if (X509_NAME_cmp(xn, X509_get_subject_name(pobj->data.x509))) return 0;
662.   		if (ctx->check_issued(ctx, x, pobj->data.x509))
