ssl/t1_lib.c:2400: error: NULL_DEREFERENCE
  pointer `null` is dereferenced by call to `ssl_security_cert()` at line 2400, column 10.
Showing all 11 steps of the trace


ssl/t1_lib.c:2391:1: start of procedure ssl_security_cert_chain()
2389.    */
2390.   
2391. > int ssl_security_cert_chain(SSL *s, STACK_OF(X509) *sk, X509 *x, int vfy)
2392.   {
2393.       int rv, start_idx, i;

ssl/t1_lib.c:2394:9: Taking true branch
2392.   {
2393.       int rv, start_idx, i;
2394.       if (x == NULL) {
                ^
2395.           x = sk_X509_value(sk, 0);
2396.           start_idx = 1;

ssl/t1_lib.c:2395:9: 
2393.       int rv, start_idx, i;
2394.       if (x == NULL) {
2395. >         x = sk_X509_value(sk, 0);
2396.           start_idx = 1;
2397.       } else

include/openssl/x509.h:99:1: start of procedure sk_X509_value()
  97.   typedef struct x509_cinf_st X509_CINF;
  98.   
  99. > DEFINE_STACK_OF(X509)
  100.   
  101.   /* This is used for a table of trust checking functions */

crypto/stack/stack.c:385:1: start of procedure OPENSSL_sk_value()
    383.   }
    384.   
    385. > void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i)
    386.   {
    387.       if (st == NULL || i < 0 || i >= st->num)

crypto/stack/stack.c:387:9: Taking true branch
    385.   void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i)
    386.   {
    387.       if (st == NULL || i < 0 || i >= st->num)
                   ^
    388.           return NULL;
    389.       return (void *)st->data[i];

crypto/stack/stack.c:388:9: 
    386.   {
    387.       if (st == NULL || i < 0 || i >= st->num)
    388. >         return NULL;
    389.       return (void *)st->data[i];
    390.   }

crypto/stack/stack.c:390:1: return from a call to OPENSSL_sk_value
    388.           return NULL;
    389.       return (void *)st->data[i];
    390. > }
    391.   
    392.   void *OPENSSL_sk_set(OPENSSL_STACK *st, int i, const void *data)

include/openssl/x509.h:99:1: return from a call to sk_X509_value
  97.   typedef struct x509_cinf_st X509_CINF;
  98.   
  99. > DEFINE_STACK_OF(X509)
  100.   
  101.   /* This is used for a table of trust checking functions */

ssl/t1_lib.c:2396:9: 
2394.       if (x == NULL) {
2395.           x = sk_X509_value(sk, 0);
2396. >         start_idx = 1;
2397.       } else
2398.           start_idx = 0;

ssl/t1_lib.c:2400:5: 
2398.           start_idx = 0;
2399.   
2400. >     rv = ssl_security_cert(s, NULL, x, vfy, 1);
2401.       if (rv != 1)
2402.           return rv;
