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


ssl/t1_lib.c:4091:1: start of procedure ssl_security_cert_chain()
4089.    */
4090.   
4091. > int ssl_security_cert_chain(SSL *s, STACK_OF(X509) *sk, X509 *x, int vfy)
4092.   {
4093.       int rv, start_idx, i;

ssl/t1_lib.c:4094:9: Taking true branch
4092.   {
4093.       int rv, start_idx, i;
4094.       if (x == NULL) {
                ^
4095.           x = sk_X509_value(sk, 0);
4096.           start_idx = 1;

ssl/t1_lib.c:4095:9: 
4093.       int rv, start_idx, i;
4094.       if (x == NULL) {
4095. >         x = sk_X509_value(sk, 0);
4096.           start_idx = 1;
4097.       } else

include/openssl/x509.h:169:1: start of procedure sk_X509_value()
  167.   typedef struct x509_cinf_st X509_CINF;
  168.   
  169. > DEFINE_STACK_OF(X509)
  170.   
  171.   /* This is used for a table of trust checking functions */

crypto/stack/stack.c:323:1: start of procedure sk_value()
    321.   }
    322.   
    323. > void *sk_value(const _STACK *st, int i)
    324.   {
    325.       if (!st || (i < 0) || (i >= st->num))

crypto/stack/stack.c:325:10: Taking true branch
    323.   void *sk_value(const _STACK *st, int i)
    324.   {
    325.       if (!st || (i < 0) || (i >= st->num))
                    ^
    326.           return NULL;
    327.       return st->data[i];

crypto/stack/stack.c:326:9: 
    324.   {
    325.       if (!st || (i < 0) || (i >= st->num))
    326. >         return NULL;
    327.       return st->data[i];
    328.   }

crypto/stack/stack.c:328:1: return from a call to sk_value
    326.           return NULL;
    327.       return st->data[i];
    328. > }
    329.   
    330.   void *sk_set(_STACK *st, int i, void *value)

include/openssl/x509.h:169:1: return from a call to sk_X509_value
  167.   typedef struct x509_cinf_st X509_CINF;
  168.   
  169. > DEFINE_STACK_OF(X509)
  170.   
  171.   /* This is used for a table of trust checking functions */

ssl/t1_lib.c:4096:9: 
4094.       if (x == NULL) {
4095.           x = sk_X509_value(sk, 0);
4096. >         start_idx = 1;
4097.       } else
4098.           start_idx = 0;

ssl/t1_lib.c:4100:5: 
4098.           start_idx = 0;
4099.   
4100. >     rv = ssl_security_cert(s, NULL, x, vfy, 1);
4101.       if (rv != 1)
4102.           return rv;

int ssl_security_cert_chain(SSL *s, STACK_OF(X509) *sk, X509 *x, int vfy)
{
    int rv, start_idx, i;
    if (x == NULL) {
        x = sk_X509_value(sk, 0);
        start_idx = 1;
    } else
        start_idx = 0;
    rv = ssl_security_cert(s, NULL, x, vfy, 1);
    if (rv != 1)
        return rv;
    for (i = start_idx; i < sk_X509_num(sk); i++) {
        x = sk_X509_value(sk, i);
        rv = ssl_security_cert(s, NULL, x, vfy, 0);
        if (rv != 1)
            return rv;
    }
    return 1;
}
['int ssl_security_cert_chain(SSL *s, STACK_OF(X509) *sk, X509 *x, int vfy)\n{\n    int rv, start_idx, i;\n    if (x == NULL) {\n        x = sk_X509_value(sk, 0);\n        start_idx = 1;\n    } else\n        start_idx = 0;\n    rv = ssl_security_cert(s, NULL, x, vfy, 1);\n    if (rv != 1)\n        return rv;\n    for (i = start_idx; i < sk_X509_num(sk); i++) {\n        x = sk_X509_value(sk, i);\n        rv = ssl_security_cert(s, NULL, x, vfy, 0);\n        if (rv != 1)\n            return rv;\n    }\n    return 1;\n}', 'DEFINE_STACK_OF(X509)', 'void *sk_value(const _STACK *st, int i)\n{\n    if (!st || (i < 0) || (i >= st->num))\n        return NULL;\n    return st->data[i];\n}']