ssl/ssl_lib.c:2890: error: BUFFER_OVERRUN_L2
  Offset: [0, max(6, `s->s3->tmp.cert_idx`)] Size: 6.
Showing all 8 steps of the trace


ssl/ssl_lib.c:2873:1: <Offset trace>
2871.   }
2872.   
2873. > CERT_PKEY *ssl_get_server_send_pkey(SSL *s)
2874.   {
2875.       CERT *c;

ssl/ssl_lib.c:2873:1: Parameter `s->s3->tmp.cert_idx`
2871.   }
2872.   
2873. > CERT_PKEY *ssl_get_server_send_pkey(SSL *s)
2874.   {
2875.       CERT *c;

ssl/ssl_lib.c:2883:9: Call
2881.       ssl_set_masks(s);
2882.   
2883.       i = ssl_get_server_cert_index(s);
                ^
2884.   
2885.       /* This may or may not be an error. */

ssl/ssl_lib.c:2852:13: Assignment
  2850.           if (s->s3->tmp.sigalg == NULL) {
  2851.               SSLerr(SSL_F_SSL_GET_SERVER_CERT_INDEX, ERR_R_INTERNAL_ERROR);
  2852.               return -1;
                      ^
  2853.           }
  2854.           return s->s3->tmp.cert_idx;

ssl/ssl_lib.c:2883:5: Assignment
2881.       ssl_set_masks(s);
2882.   
2883.       i = ssl_get_server_cert_index(s);
            ^
2884.   
2885.       /* This may or may not be an error. */

ssl/ssl_lib.c:2873:1: <Length trace>
2871.   }
2872.   
2873. > CERT_PKEY *ssl_get_server_send_pkey(SSL *s)
2874.   {
2875.       CERT *c;

ssl/ssl_lib.c:2873:1: Parameter `s->cert->pkeys[*]`
2871.   }
2872.   
2873. > CERT_PKEY *ssl_get_server_send_pkey(SSL *s)
2874.   {
2875.       CERT *c;

ssl/ssl_lib.c:2890:5: Array access: Offset: [0, max(6, s->s3->tmp.cert_idx)] Size: 6
2888.   
2889.       /* May be NULL. */
2890.       return &c->pkeys[i];
            ^
2891.   }
2892.   

CERT_PKEY *ssl_get_server_send_pkey(SSL *s)
{
    CERT *c;
    int i;
    c = s->cert;
    if (!s->s3 || !s->s3->tmp.new_cipher)
        return NULL;
    ssl_set_masks(s);
    i = ssl_get_server_cert_index(s);
    if (i < 0)
        return NULL;
    return &c->pkeys[i];
}
['CERT_PKEY *ssl_get_server_send_pkey(SSL *s)\n{\n    CERT *c;\n    int i;\n    c = s->cert;\n    if (!s->s3 || !s->s3->tmp.new_cipher)\n        return NULL;\n    ssl_set_masks(s);\n    i = ssl_get_server_cert_index(s);\n    if (i < 0)\n        return NULL;\n    return &c->pkeys[i];\n}', 'static int ssl_get_server_cert_index(const SSL *s)\n{\n    int idx;\n    if (SSL_IS_TLS13(s)) {\n        if (s->s3->tmp.sigalg == NULL) {\n            SSLerr(SSL_F_SSL_GET_SERVER_CERT_INDEX, ERR_R_INTERNAL_ERROR);\n            return -1;\n        }\n        return s->s3->tmp.cert_idx;\n    }\n    idx = ssl_cipher_get_cert_index(s->s3->tmp.new_cipher);\n    if (idx == SSL_PKEY_GOST_EC) {\n        if (s->cert->pkeys[SSL_PKEY_GOST12_512].x509)\n            idx = SSL_PKEY_GOST12_512;\n        else if (s->cert->pkeys[SSL_PKEY_GOST12_256].x509)\n            idx = SSL_PKEY_GOST12_256;\n        else if (s->cert->pkeys[SSL_PKEY_GOST01].x509)\n            idx = SSL_PKEY_GOST01;\n        else\n            idx = -1;\n    }\n    if (idx == -1)\n        SSLerr(SSL_F_SSL_GET_SERVER_CERT_INDEX, ERR_R_INTERNAL_ERROR);\n    return idx;\n}']