apps/s_server.c:2808: error: BUFFER_OVERRUN_L1
  Offset: -1 Size: 8192 by call to `SSL_get_shared_ciphers`.
Showing all 6 steps of the trace


apps/s_server.c:2782:1: Array declaration
2780.   }
2781.   
2782. > static void print_connection_info(SSL *con)
2783.   {
2784.       const char *str;

apps/s_server.c:2808:9: Call
2806.       }
2807.   
2808.       if (SSL_get_shared_ciphers(con, buf, sizeof buf) != NULL)
                ^
2809.           BIO_printf(bio_s_out, "Shared ciphers:%s\n", buf);
2810.       str = SSL_CIPHER_get_name(SSL_get_current_cipher(con));

ssl/ssl_lib.c:2460:1: <Length trace>
2458.   }
2459.   
2460. > char *SSL_get_shared_ciphers(const SSL *s, char *buf, int len)
2461.   {
2462.       char *p;

ssl/ssl_lib.c:2460:1: Parameter `*buf`
  2458.   }
  2459.   
  2460. > char *SSL_get_shared_ciphers(const SSL *s, char *buf, int len)
  2461.   {
  2462.       char *p;

ssl/ssl_lib.c:2470:5: Assignment
  2468.           return NULL;
  2469.   
  2470.       p = buf;
              ^
  2471.       sk = s->session->ciphers;
  2472.   

ssl/ssl_lib.c:2492:5: Array access: Offset: -1 Size: 8192 by call to `SSL_get_shared_ciphers` 
  2490.           len -= n + 1;
  2491.       }
  2492.       p[-1] = '\0';
              ^
  2493.       return buf;
  2494.   }

char *SSL_get_shared_ciphers(const SSL *s, char *buf, int len)
{
    char *p;
    STACK_OF(SSL_CIPHER) *sk;
    const SSL_CIPHER *c;
    int i;
    if ((s->session == NULL) || (s->session->ciphers == NULL) || (len < 2))
        return NULL;
    p = buf;
    sk = s->session->ciphers;
    if (sk_SSL_CIPHER_num(sk) == 0)
        return NULL;
    for (i = 0; i < sk_SSL_CIPHER_num(sk); i++) {
        int n;
        c = sk_SSL_CIPHER_value(sk, i);
        n = strlen(c->name);
        if (n + 1 > len) {
            if (p != buf)
                --p;
            *p = '\0';
            return buf;
        }
        strcpy(p, c->name);
        p += n;
        *(p++) = ':';
        len -= n + 1;
    }
    p[-1] = '\0';
    return buf;
}
['static void print_connection_info(SSL *con)\n{\n    const char *str;\n    X509 *peer;\n    char buf[BUFSIZ];\n#if !defined(OPENSSL_NO_NEXTPROTONEG)\n    const unsigned char *next_proto_neg;\n    unsigned next_proto_neg_len;\n#endif\n    unsigned char *exportedkeymat;\n    int i;\n    if (s_brief)\n        print_ssl_summary(con);\n    PEM_write_bio_SSL_SESSION(bio_s_out, SSL_get_session(con));\n    peer = SSL_get_peer_certificate(con);\n    if (peer != NULL) {\n        BIO_printf(bio_s_out, "Client certificate\\n");\n        PEM_write_bio_X509(bio_s_out, peer);\n        dump_cert_text(bio_s_out, peer);\n        X509_free(peer);\n        peer = NULL;\n    }\n    if (SSL_get_shared_ciphers(con, buf, sizeof buf) != NULL)\n        BIO_printf(bio_s_out, "Shared ciphers:%s\\n", buf);\n    str = SSL_CIPHER_get_name(SSL_get_current_cipher(con));\n    ssl_print_sigalgs(bio_s_out, con);\n#ifndef OPENSSL_NO_EC\n    ssl_print_point_formats(bio_s_out, con);\n    ssl_print_groups(bio_s_out, con, 0);\n#endif\n    print_ca_names(bio_s_out, con);\n    BIO_printf(bio_s_out, "CIPHER is %s\\n", (str != NULL) ? str : "(NONE)");\n#if !defined(OPENSSL_NO_NEXTPROTONEG)\n    SSL_get0_next_proto_negotiated(con, &next_proto_neg, &next_proto_neg_len);\n    if (next_proto_neg) {\n        BIO_printf(bio_s_out, "NEXTPROTO is ");\n        BIO_write(bio_s_out, next_proto_neg, next_proto_neg_len);\n        BIO_printf(bio_s_out, "\\n");\n    }\n#endif\n#ifndef OPENSSL_NO_SRTP\n    {\n        SRTP_PROTECTION_PROFILE *srtp_profile\n            = SSL_get_selected_srtp_profile(con);\n        if (srtp_profile)\n            BIO_printf(bio_s_out, "SRTP Extension negotiated, profile=%s\\n",\n                       srtp_profile->name);\n    }\n#endif\n    if (SSL_session_reused(con))\n        BIO_printf(bio_s_out, "Reused session-id\\n");\n    BIO_printf(bio_s_out, "Secure Renegotiation IS%s supported\\n",\n               SSL_get_secure_renegotiation_support(con) ? "" : " NOT");\n    if ((SSL_get_options(con) & SSL_OP_NO_RENEGOTIATION))\n        BIO_printf(bio_s_out, "Renegotiation is DISABLED\\n");\n    if (keymatexportlabel != NULL) {\n        BIO_printf(bio_s_out, "Keying material exporter:\\n");\n        BIO_printf(bio_s_out, "    Label: \'%s\'\\n", keymatexportlabel);\n        BIO_printf(bio_s_out, "    Length: %i bytes\\n", keymatexportlen);\n        exportedkeymat = app_malloc(keymatexportlen, "export key");\n        if (!SSL_export_keying_material(con, exportedkeymat,\n                                        keymatexportlen,\n                                        keymatexportlabel,\n                                        strlen(keymatexportlabel),\n                                        NULL, 0, 0)) {\n            BIO_printf(bio_s_out, "    Error\\n");\n        } else {\n            BIO_printf(bio_s_out, "    Keying material: ");\n            for (i = 0; i < keymatexportlen; i++)\n                BIO_printf(bio_s_out, "%02X", exportedkeymat[i]);\n            BIO_printf(bio_s_out, "\\n");\n        }\n        OPENSSL_free(exportedkeymat);\n    }\n    (void)BIO_flush(bio_s_out);\n}', "char *SSL_get_shared_ciphers(const SSL *s, char *buf, int len)\n{\n    char *p;\n    STACK_OF(SSL_CIPHER) *sk;\n    const SSL_CIPHER *c;\n    int i;\n    if ((s->session == NULL) || (s->session->ciphers == NULL) || (len < 2))\n        return NULL;\n    p = buf;\n    sk = s->session->ciphers;\n    if (sk_SSL_CIPHER_num(sk) == 0)\n        return NULL;\n    for (i = 0; i < sk_SSL_CIPHER_num(sk); i++) {\n        int n;\n        c = sk_SSL_CIPHER_value(sk, i);\n        n = strlen(c->name);\n        if (n + 1 > len) {\n            if (p != buf)\n                --p;\n            *p = '\\0';\n            return buf;\n        }\n        strcpy(p, c->name);\n        p += n;\n        *(p++) = ':';\n        len -= n + 1;\n    }\n    p[-1] = '\\0';\n    return buf;\n}"]