crypto/x509/x509_vfy.c:1201: error: NULL_DEREFERENCE
  pointer `cert_ta` last assigned on line 1199 could be null and is dereferenced by call to `X509_cmp()` at line 1201, column 7.
Showing all 32 steps of the trace


crypto/x509/x509_vfy.c:1194:1: start of procedure check_crl_chain()
1192.    */
1193.   
1194. > static int check_crl_chain(X509_STORE_CTX *ctx,
1195.   			STACK_OF(X509) *cert_path,
1196.   			STACK_OF(X509) *crl_path)

crypto/x509/x509_vfy.c:1199:12: Condition is true
1197.   	{
1198.   	X509 *cert_ta, *crl_ta;
1199.   	cert_ta = sk_X509_value(cert_path, sk_X509_num(cert_path) - 1);
                   ^
1200.   	crl_ta = sk_X509_value(crl_path, sk_X509_num(crl_path) - 1);
1201.   	if (!X509_cmp(cert_ta, crl_ta))

crypto/x509/x509_vfy.c:1199:12: Condition is true
1197.   	{
1198.   	X509 *cert_ta, *crl_ta;
1199.   	cert_ta = sk_X509_value(cert_path, sk_X509_num(cert_path) - 1);
                   ^
1200.   	crl_ta = sk_X509_value(crl_path, sk_X509_num(crl_path) - 1);
1201.   	if (!X509_cmp(cert_ta, crl_ta))

crypto/x509/x509_vfy.c:1199:2: 
1197.   	{
1198.   	X509 *cert_ta, *crl_ta;
1199. > 	cert_ta = sk_X509_value(cert_path, sk_X509_num(cert_path) - 1);
1200.   	crl_ta = sk_X509_value(crl_path, sk_X509_num(crl_path) - 1);
1201.   	if (!X509_cmp(cert_ta, crl_ta))

crypto/stack/stack.c:294:1: start of procedure sk_num()
  292.   	}
  293.   
  294. > int sk_num(const _STACK *st)
  295.   {
  296.   	if(st == NULL) return -1;

crypto/stack/stack.c:296:5: Taking false branch
  294.   int sk_num(const _STACK *st)
  295.   {
  296.   	if(st == NULL) return -1;
             ^
  297.   	return st->num;
  298.   }

crypto/stack/stack.c:297:2: 
  295.   {
  296.   	if(st == NULL) return -1;
  297. > 	return st->num;
  298.   }
  299.   

crypto/stack/stack.c:298:1: return from a call to sk_num
  296.   	if(st == NULL) return -1;
  297.   	return st->num;
  298. > }
  299.   
  300.   void *sk_value(const _STACK *st, int i)

crypto/stack/stack.c:300:1: start of procedure sk_value()
  298.   }
  299.   
  300. > void *sk_value(const _STACK *st, int i)
  301.   {
  302.   	if(!st || (i < 0) || (i >= st->num)) return NULL;

crypto/stack/stack.c:302:6: Taking false branch
  300.   void *sk_value(const _STACK *st, int i)
  301.   {
  302.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
              ^
  303.   	return st->data[i];
  304.   }

crypto/stack/stack.c:302:13: Taking true branch
  300.   void *sk_value(const _STACK *st, int i)
  301.   {
  302.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
                     ^
  303.   	return st->data[i];
  304.   }

crypto/stack/stack.c:302:39: 
  300.   void *sk_value(const _STACK *st, int i)
  301.   {
  302. > 	if(!st || (i < 0) || (i >= st->num)) return NULL;
  303.   	return st->data[i];
  304.   }

crypto/stack/stack.c:304:1: return from a call to sk_value
  302.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
  303.   	return st->data[i];
  304. > }
  305.   
  306.   void *sk_set(_STACK *st, int i, void *value)

crypto/x509/x509_vfy.c:1200:11: Condition is true
1198.   	X509 *cert_ta, *crl_ta;
1199.   	cert_ta = sk_X509_value(cert_path, sk_X509_num(cert_path) - 1);
1200.   	crl_ta = sk_X509_value(crl_path, sk_X509_num(crl_path) - 1);
                  ^
1201.   	if (!X509_cmp(cert_ta, crl_ta))
1202.   		return 1;

crypto/x509/x509_vfy.c:1200:11: Condition is true
1198.   	X509 *cert_ta, *crl_ta;
1199.   	cert_ta = sk_X509_value(cert_path, sk_X509_num(cert_path) - 1);
1200.   	crl_ta = sk_X509_value(crl_path, sk_X509_num(crl_path) - 1);
                  ^
1201.   	if (!X509_cmp(cert_ta, crl_ta))
1202.   		return 1;

crypto/x509/x509_vfy.c:1200:2: 
1198.   	X509 *cert_ta, *crl_ta;
1199.   	cert_ta = sk_X509_value(cert_path, sk_X509_num(cert_path) - 1);
1200. > 	crl_ta = sk_X509_value(crl_path, sk_X509_num(crl_path) - 1);
1201.   	if (!X509_cmp(cert_ta, crl_ta))
1202.   		return 1;

crypto/stack/stack.c:294:1: start of procedure sk_num()
  292.   	}
  293.   
  294. > int sk_num(const _STACK *st)
  295.   {
  296.   	if(st == NULL) return -1;

crypto/stack/stack.c:296:5: Taking false branch
  294.   int sk_num(const _STACK *st)
  295.   {
  296.   	if(st == NULL) return -1;
             ^
  297.   	return st->num;
  298.   }

crypto/stack/stack.c:297:2: 
  295.   {
  296.   	if(st == NULL) return -1;
  297. > 	return st->num;
  298.   }
  299.   

crypto/stack/stack.c:298:1: return from a call to sk_num
  296.   	if(st == NULL) return -1;
  297.   	return st->num;
  298. > }
  299.   
  300.   void *sk_value(const _STACK *st, int i)

crypto/stack/stack.c:300:1: start of procedure sk_value()
  298.   }
  299.   
  300. > void *sk_value(const _STACK *st, int i)
  301.   {
  302.   	if(!st || (i < 0) || (i >= st->num)) return NULL;

crypto/stack/stack.c:302:6: Taking false branch
  300.   void *sk_value(const _STACK *st, int i)
  301.   {
  302.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
              ^
  303.   	return st->data[i];
  304.   }

crypto/stack/stack.c:302:13: Taking false branch
  300.   void *sk_value(const _STACK *st, int i)
  301.   {
  302.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
                     ^
  303.   	return st->data[i];
  304.   }

crypto/stack/stack.c:302:24: Taking false branch
  300.   void *sk_value(const _STACK *st, int i)
  301.   {
  302.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
                                ^
  303.   	return st->data[i];
  304.   }

crypto/stack/stack.c:303:2: 
  301.   {
  302.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
  303. > 	return st->data[i];
  304.   }
  305.   

crypto/stack/stack.c:304:1: return from a call to sk_value
  302.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
  303.   	return st->data[i];
  304. > }
  305.   
  306.   void *sk_set(_STACK *st, int i, void *value)

crypto/x509/x509_vfy.c:1201:7: 
1199.   	cert_ta = sk_X509_value(cert_path, sk_X509_num(cert_path) - 1);
1200.   	crl_ta = sk_X509_value(crl_path, sk_X509_num(crl_path) - 1);
1201. > 	if (!X509_cmp(cert_ta, crl_ta))
1202.   		return 1;
1203.   	return 0;

crypto/x509/x509_cmp.c:179:1: start of procedure X509_cmp()
  177.    * with an evil cast.
  178.    */
  179. > int X509_cmp(const X509 *a, const X509 *b)
  180.   {
  181.   	/* ensure hash is valid */

crypto/x509/x509_cmp.c:182:2: Skipping X509_check_purpose(): empty list of specs
  180.   {
  181.   	/* ensure hash is valid */
  182.   	X509_check_purpose((X509 *)a, -1, 0);
          ^
  183.   	X509_check_purpose((X509 *)b, -1, 0);
  184.   

crypto/x509/x509_cmp.c:183:2: Skipping X509_check_purpose(): empty list of specs
  181.   	/* ensure hash is valid */
  182.   	X509_check_purpose((X509 *)a, -1, 0);
  183.   	X509_check_purpose((X509 *)b, -1, 0);
          ^
  184.   
  185.   	return memcmp(a->sha1_hash, b->sha1_hash, SHA_DIGEST_LENGTH);

crypto/x509/x509_cmp.c:185:2: 
  183.   	X509_check_purpose((X509 *)b, -1, 0);
  184.   
  185. > 	return memcmp(a->sha1_hash, b->sha1_hash, SHA_DIGEST_LENGTH);
  186.   }
  187.   #endif

crypto/x509/x509_cmp.c:186:1: return from a call to X509_cmp
  184.   
  185.   	return memcmp(a->sha1_hash, b->sha1_hash, SHA_DIGEST_LENGTH);
  186. > }
  187.   #endif
  188.   
