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


ssl/t1_lib.c:4072:1: start of procedure ssl_security_cert_chain()
4070.    */
4071.   
4072. > int ssl_security_cert_chain(SSL *s, STACK_OF(X509) *sk, X509 *x, int vfy)
4073.   {
4074.       int rv, start_idx, i;

ssl/t1_lib.c:4075:9: Taking false branch
4073.   {
4074.       int rv, start_idx, i;
4075.       if (x == NULL) {
                ^
4076.           x = sk_X509_value(sk, 0);
4077.           start_idx = 1;

ssl/t1_lib.c:4079:9: 
4077.           start_idx = 1;
4078.       } else
4079. >         start_idx = 0;
4080.   
4081.       rv = ssl_security_cert(s, NULL, x, vfy, 1);

ssl/t1_lib.c:4081:5: 
4079.           start_idx = 0;
4080.   
4081. >     rv = ssl_security_cert(s, NULL, x, vfy, 1);
4082.       if (rv != 1)
4083.           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}']