crypto/x509/x509_cmp.c:283: error: NULL_DEREFERENCE
  pointer `nb` last assigned on line 282 could be null and is dereferenced at line 283, column 21.
Showing all 32 steps of the trace


crypto/x509/x509_cmp.c:268:1: start of procedure X509_NAME_cmp()
266.   #define STR_TYPE_CMP (B_ASN1_PRINTABLESTRING|B_ASN1_T61STRING|B_ASN1_UTF8STRING)
267.   
268. > int X509_NAME_cmp(const X509_NAME *a, const X509_NAME *b)
269.   	{
270.   	int i,j;

crypto/x509/x509_cmp.c:275:2: 
273.   	unsigned long nabit, nbbit;
274.   
275. > 	j = sk_X509_NAME_ENTRY_num(a->entries)
276.   		  - sk_X509_NAME_ENTRY_num(b->entries);
277.   	if (j)

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

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

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

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

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

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

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

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

crypto/x509/x509_cmp.c:277:6: Taking false branch
275.   	j = sk_X509_NAME_ENTRY_num(a->entries)
276.   		  - sk_X509_NAME_ENTRY_num(b->entries);
277.   	if (j)
            ^
278.   		return j;
279.   	for (i=sk_X509_NAME_ENTRY_num(a->entries)-1; i>=0; i--)

crypto/x509/x509_cmp.c:279:7: 
277.   	if (j)
278.   		return j;
279. > 	for (i=sk_X509_NAME_ENTRY_num(a->entries)-1; i>=0; i--)
280.   		{
281.   		na=sk_X509_NAME_ENTRY_value(a->entries,i);

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

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

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

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

crypto/x509/x509_cmp.c:279:47: Loop condition is true. Entering loop body
277.   	if (j)
278.   		return j;
279.   	for (i=sk_X509_NAME_ENTRY_num(a->entries)-1; i>=0; i--)
                                                     ^
280.   		{
281.   		na=sk_X509_NAME_ENTRY_value(a->entries,i);

crypto/x509/x509_cmp.c:281:3: 
279.   	for (i=sk_X509_NAME_ENTRY_num(a->entries)-1; i>=0; i--)
280.   		{
281. > 		na=sk_X509_NAME_ENTRY_value(a->entries,i);
282.   		nb=sk_X509_NAME_ENTRY_value(b->entries,i);
283.   		j=na->value->type-nb->value->type;

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

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

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

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

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

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

crypto/x509/x509_cmp.c:282:3: 
280.   		{
281.   		na=sk_X509_NAME_ENTRY_value(a->entries,i);
282. > 		nb=sk_X509_NAME_ENTRY_value(b->entries,i);
283.   		j=na->value->type-nb->value->type;
284.   		if (j)

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

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

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

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

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

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

crypto/x509/x509_cmp.c:283:3: 
281.   		na=sk_X509_NAME_ENTRY_value(a->entries,i);
282.   		nb=sk_X509_NAME_ENTRY_value(b->entries,i);
283. > 		j=na->value->type-nb->value->type;
284.   		if (j)
285.   			{
