apps/ciphers.c:159: error: INTEGER_OVERFLOW_L2
  ([0, +oo] - 1):unsigned64 by call to `SSL_new`.
Showing all 14 steps of the trace


apps/ciphers.c:159:11: Call
157.           }
158.       }
159.       ssl = SSL_new(ctx);
                 ^
160.       if (ssl == NULL)
161.           goto err;

ssl/ssl_lib.c:267:1: Parameter `ctx->sessions->num_items`
  265.   }
  266.   
  267. > SSL *SSL_new(SSL_CTX *ctx)
  268.   {
  269.       SSL *s;

ssl/ssl_lib.c:378:10: Call
  376.       s->server = (ctx->method->ssl_accept == ssl_undefined_function) ? 0 : 1;
  377.   
  378.       if (!SSL_clear(s))
                  ^
  379.           goto err;
  380.   

ssl/ssl_lib.c:197:1: Parameter `s->ctx->sessions->num_items`
    195.   }
    196.   
    197. > int SSL_clear(SSL *s)
    198.   {
    199.       if (s->method == NULL) {

ssl/ssl_lib.c:204:9: Call
    202.       }
    203.   
    204.       if (ssl_clear_bad_session(s)) {
                   ^
    205.           SSL_SESSION_free(s->session);
    206.           s->session = NULL;

ssl/ssl_sess.c:1068:1: Parameter `s->ctx->sessions->num_items`
      1066.   }
      1067.   
      1068. > int ssl_clear_bad_session(SSL *s)
      1069.   {
      1070.       if ((s->session != NULL) &&

ssl/ssl_sess.c:1073:9: Call
      1071.           !(s->shutdown & SSL_SENT_SHUTDOWN) &&
      1072.           !(SSL_in_init(s) || SSL_in_before(s))) {
      1073.           SSL_CTX_remove_session(s->ctx, s->session);
                      ^
      1074.           return (1);
      1075.       } else

ssl/ssl_sess.c:769:1: Parameter `ctx->sessions->num_items`
        767.   }
        768.   
        769. > int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c)
        770.   {
        771.       return remove_session_lock(ctx, c, 1);

ssl/ssl_sess.c:771:12: Call
        769.   int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c)
        770.   {
        771.       return remove_session_lock(ctx, c, 1);
                          ^
        772.   }
        773.   

ssl/ssl_sess.c:774:1: Parameter `ctx->sessions->num_items`
          772.   }
          773.   
          774. > static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck)
          775.   {
          776.       SSL_SESSION *r;

ssl/ssl_sess.c:784:17: Call
          782.           if ((r = lh_SSL_SESSION_retrieve(ctx->sessions, c)) == c) {
          783.               ret = 1;
          784.               r = lh_SSL_SESSION_delete(ctx->sessions, c);
                                 ^
          785.               SSL_SESSION_list_remove(ctx, c);
          786.           }

crypto/lhash/lhash.c:189:1: <LHS trace>
187.   }
188.   
189. > void *lh_delete(_LHASH *lh, const void *data)
190.   {
191.       unsigned long hash;

crypto/lhash/lhash.c:189:1: Parameter `lh->num_items`
            187.   }
            188.   
            189. > void *lh_delete(_LHASH *lh, const void *data)
            190.   {
            191.       unsigned long hash;

crypto/lhash/lhash.c:209:5: Binary operation: ([0, +oo] - 1):unsigned64 by call to `SSL_new` 
            207.       }
            208.   
            209.       lh->num_items--;
                       ^
            210.       if ((lh->num_nodes > MIN_NODES) &&
            211.           (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)))

void *lh_delete(_LHASH *lh, const void *data)
{
    unsigned long hash;
    LHASH_NODE *nn, **rn;
    void *ret;
    lh->error = 0;
    rn = getrn(lh, data, &hash);
    if (*rn == NULL) {
        lh->num_no_delete++;
        return (NULL);
    } else {
        nn = *rn;
        *rn = nn->next;
        ret = nn->data;
        OPENSSL_free(nn);
        lh->num_delete++;
    }
    lh->num_items--;
    if ((lh->num_nodes > MIN_NODES) &&
        (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)))
        contract(lh);
    return (ret);
}
['int ciphers_main(int argc, char **argv)\n{\n    SSL_CTX *ctx = NULL;\n    SSL *ssl = NULL;\n    STACK_OF(SSL_CIPHER) *sk = NULL;\n    const SSL_METHOD *meth = TLS_server_method();\n    int ret = 1, i, verbose = 0, Verbose = 0, use_supported = 0;\n#ifndef OPENSSL_NO_SSL_TRACE\n    int stdname = 0;\n#endif\n    const char *p;\n    char *ciphers = NULL, *prog;\n    char buf[512];\n    OPTION_CHOICE o;\n    prog = opt_init(argc, argv, ciphers_options);\n    while ((o = opt_next()) != OPT_EOF) {\n        switch (o) {\n        case OPT_EOF:\n        case OPT_ERR:\n opthelp:\n            BIO_printf(bio_err, "%s: Use -help for summary.\\n", prog);\n            goto end;\n        case OPT_HELP:\n            opt_help(ciphers_options);\n            ret = 0;\n            goto end;\n        case OPT_V:\n            verbose = 1;\n            break;\n        case OPT_UPPER_V:\n            verbose = Verbose = 1;\n            break;\n        case OPT_S:\n            use_supported = 1;\n            break;\n        case OPT_STDNAME:\n#ifndef OPENSSL_NO_SSL_TRACE\n            stdname = verbose = 1;\n#endif\n            break;\n        case OPT_SSL3:\n#ifndef OPENSSL_NO_SSL3\n            meth = SSLv3_client_method();\n#endif\n            break;\n        case OPT_TLS1:\n            meth = TLSv1_client_method();\n            break;\n        }\n    }\n    argv = opt_rest();\n    argc = opt_num_rest();\n    if (argc == 1)\n        ciphers = *argv;\n    else if (argc != 0)\n        goto opthelp;\n    if (!app_load_modules(NULL))\n        goto end;\n    ctx = SSL_CTX_new(meth);\n    if (ctx == NULL)\n        goto err;\n    if (ciphers != NULL) {\n        if (!SSL_CTX_set_cipher_list(ctx, ciphers)) {\n            BIO_printf(bio_err, "Error in cipher list\\n");\n            goto err;\n        }\n    }\n    ssl = SSL_new(ctx);\n    if (ssl == NULL)\n        goto err;\n    if (use_supported)\n        sk = SSL_get1_supported_ciphers(ssl);\n    else\n        sk = SSL_get_ciphers(ssl);\n    if (!verbose) {\n        for (i = 0; i < sk_SSL_CIPHER_num(sk); i++) {\n            SSL_CIPHER *c = sk_SSL_CIPHER_value(sk, i);\n            p = SSL_CIPHER_get_name(c);\n            if (p == NULL)\n                break;\n            if (i != 0)\n                BIO_printf(bio_out, ":");\n            BIO_printf(bio_out, "%s", p);\n        }\n        BIO_printf(bio_out, "\\n");\n    } else {\n        for (i = 0; i < sk_SSL_CIPHER_num(sk); i++) {\n            SSL_CIPHER *c;\n            c = sk_SSL_CIPHER_value(sk, i);\n            if (Verbose) {\n                unsigned long id = SSL_CIPHER_get_id(c);\n                int id0 = (int)(id >> 24);\n                int id1 = (int)((id >> 16) & 0xffL);\n                int id2 = (int)((id >> 8) & 0xffL);\n                int id3 = (int)(id & 0xffL);\n                if ((id & 0xff000000L) == 0x03000000L)\n                    BIO_printf(bio_out, "          0x%02X,0x%02X - ", id2, id3);\n                else\n                    BIO_printf(bio_out, "0x%02X,0x%02X,0x%02X,0x%02X - ", id0, id1, id2, id3);\n            }\n#ifndef OPENSSL_NO_SSL_TRACE\n            if (stdname) {\n                const char *nm = SSL_CIPHER_standard_name(c);\n                if (nm == NULL)\n                    nm = "UNKNOWN";\n                BIO_printf(bio_out, "%s - ", nm);\n            }\n#endif\n            BIO_puts(bio_out, SSL_CIPHER_description(c, buf, sizeof buf));\n        }\n    }\n    ret = 0;\n    goto end;\n err:\n    ERR_print_errors(bio_err);\n end:\n    if (use_supported)\n        sk_SSL_CIPHER_free(sk);\n    SSL_CTX_free(ctx);\n    SSL_free(ssl);\n    return (ret);\n}', 'SSL *SSL_new(SSL_CTX *ctx)\n{\n    SSL *s;\n    if (ctx == NULL) {\n        SSLerr(SSL_F_SSL_NEW, SSL_R_NULL_SSL_CTX);\n        return (NULL);\n    }\n    if (ctx->method == NULL) {\n        SSLerr(SSL_F_SSL_NEW, SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION);\n        return (NULL);\n    }\n    s = OPENSSL_zalloc(sizeof(*s));\n    if (s == NULL)\n        goto err;\n    RECORD_LAYER_init(&s->rlayer, s);\n    s->options = ctx->options;\n    s->mode = ctx->mode;\n    s->max_cert_list = ctx->max_cert_list;\n    s->cert = ssl_cert_dup(ctx->cert);\n    if (s->cert == NULL)\n        goto err;\n    RECORD_LAYER_set_read_ahead(&s->rlayer, ctx->read_ahead);\n    s->msg_callback = ctx->msg_callback;\n    s->msg_callback_arg = ctx->msg_callback_arg;\n    s->verify_mode = ctx->verify_mode;\n    s->not_resumable_session_cb = ctx->not_resumable_session_cb;\n    s->sid_ctx_length = ctx->sid_ctx_length;\n    OPENSSL_assert(s->sid_ctx_length <= sizeof s->sid_ctx);\n    memcpy(&s->sid_ctx, &ctx->sid_ctx, sizeof(s->sid_ctx));\n    s->verify_callback = ctx->default_verify_callback;\n    s->generate_session_id = ctx->generate_session_id;\n    s->param = X509_VERIFY_PARAM_new();\n    if (!s->param)\n        goto err;\n    X509_VERIFY_PARAM_inherit(s->param, ctx->param);\n    s->quiet_shutdown = ctx->quiet_shutdown;\n    s->max_send_fragment = ctx->max_send_fragment;\n    CRYPTO_add(&ctx->references, 1, CRYPTO_LOCK_SSL_CTX);\n    s->ctx = ctx;\n    s->tlsext_debug_cb = 0;\n    s->tlsext_debug_arg = NULL;\n    s->tlsext_ticket_expected = 0;\n    s->tlsext_status_type = -1;\n    s->tlsext_status_expected = 0;\n    s->tlsext_ocsp_ids = NULL;\n    s->tlsext_ocsp_exts = NULL;\n    s->tlsext_ocsp_resp = NULL;\n    s->tlsext_ocsp_resplen = -1;\n    CRYPTO_add(&ctx->references, 1, CRYPTO_LOCK_SSL_CTX);\n    s->initial_ctx = ctx;\n# ifndef OPENSSL_NO_EC\n    if (ctx->tlsext_ecpointformatlist) {\n        s->tlsext_ecpointformatlist =\n            BUF_memdup(ctx->tlsext_ecpointformatlist,\n                       ctx->tlsext_ecpointformatlist_length);\n        if (!s->tlsext_ecpointformatlist)\n            goto err;\n        s->tlsext_ecpointformatlist_length =\n            ctx->tlsext_ecpointformatlist_length;\n    }\n    if (ctx->tlsext_ellipticcurvelist) {\n        s->tlsext_ellipticcurvelist =\n            BUF_memdup(ctx->tlsext_ellipticcurvelist,\n                       ctx->tlsext_ellipticcurvelist_length);\n        if (!s->tlsext_ellipticcurvelist)\n            goto err;\n        s->tlsext_ellipticcurvelist_length =\n            ctx->tlsext_ellipticcurvelist_length;\n    }\n# endif\n# ifndef OPENSSL_NO_NEXTPROTONEG\n    s->next_proto_negotiated = NULL;\n# endif\n    if (s->ctx->alpn_client_proto_list) {\n        s->alpn_client_proto_list =\n            OPENSSL_malloc(s->ctx->alpn_client_proto_list_len);\n        if (s->alpn_client_proto_list == NULL)\n            goto err;\n        memcpy(s->alpn_client_proto_list, s->ctx->alpn_client_proto_list,\n               s->ctx->alpn_client_proto_list_len);\n        s->alpn_client_proto_list_len = s->ctx->alpn_client_proto_list_len;\n    }\n    s->verify_result = X509_V_OK;\n    s->method = ctx->method;\n    if (!s->method->ssl_new(s))\n        goto err;\n    s->references = 1;\n    s->server = (ctx->method->ssl_accept == ssl_undefined_function) ? 0 : 1;\n    if (!SSL_clear(s))\n        goto err;\n    CRYPTO_new_ex_data(CRYPTO_EX_INDEX_SSL, s, &s->ex_data);\n#ifndef OPENSSL_NO_PSK\n    s->psk_client_callback = ctx->psk_client_callback;\n    s->psk_server_callback = ctx->psk_server_callback;\n#endif\n    return (s);\n err:\n    SSL_free(s);\n    SSLerr(SSL_F_SSL_NEW, ERR_R_MALLOC_FAILURE);\n    return (NULL);\n}', 'int SSL_clear(SSL *s)\n{\n    if (s->method == NULL) {\n        SSLerr(SSL_F_SSL_CLEAR, SSL_R_NO_METHOD_SPECIFIED);\n        return (0);\n    }\n    if (ssl_clear_bad_session(s)) {\n        SSL_SESSION_free(s->session);\n        s->session = NULL;\n    }\n    s->error = 0;\n    s->hit = 0;\n    s->shutdown = 0;\n    if (s->renegotiate) {\n        SSLerr(SSL_F_SSL_CLEAR, ERR_R_INTERNAL_ERROR);\n        return 0;\n    }\n    s->type = 0;\n    s->state = SSL_ST_BEFORE | ((s->server) ? SSL_ST_ACCEPT : SSL_ST_CONNECT);\n    s->version = s->method->version;\n    s->client_version = s->version;\n    s->rwstate = SSL_NOTHING;\n    BUF_MEM_free(s->init_buf);\n    s->init_buf = NULL;\n    clear_ciphers(s);\n    s->first_packet = 0;\n    if (!s->in_handshake && (s->session == NULL)\n        && (s->method != s->ctx->method)) {\n        s->method->ssl_free(s);\n        s->method = s->ctx->method;\n        if (!s->method->ssl_new(s))\n            return (0);\n    } else\n        s->method->ssl_clear(s);\n    RECORD_LAYER_clear(&s->rlayer);\n    return (1);\n}', 'int ssl_clear_bad_session(SSL *s)\n{\n    if ((s->session != NULL) &&\n        !(s->shutdown & SSL_SENT_SHUTDOWN) &&\n        !(SSL_in_init(s) || SSL_in_before(s))) {\n        SSL_CTX_remove_session(s->ctx, s->session);\n        return (1);\n    } else\n        return (0);\n}', 'int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c)\n{\n    return remove_session_lock(ctx, c, 1);\n}', 'static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck)\n{\n    SSL_SESSION *r;\n    int ret = 0;\n    if ((c != NULL) && (c->session_id_length != 0)) {\n        if (lck)\n            CRYPTO_w_lock(CRYPTO_LOCK_SSL_CTX);\n        if ((r = lh_SSL_SESSION_retrieve(ctx->sessions, c)) == c) {\n            ret = 1;\n            r = lh_SSL_SESSION_delete(ctx->sessions, c);\n            SSL_SESSION_list_remove(ctx, c);\n        }\n        if (lck)\n            CRYPTO_w_unlock(CRYPTO_LOCK_SSL_CTX);\n        if (ret) {\n            r->not_resumable = 1;\n            if (ctx->remove_session_cb != NULL)\n                ctx->remove_session_cb(ctx, r);\n            SSL_SESSION_free(r);\n        }\n    } else\n        ret = 0;\n    return (ret);\n}', 'void *lh_delete(_LHASH *lh, const void *data)\n{\n    unsigned long hash;\n    LHASH_NODE *nn, **rn;\n    void *ret;\n    lh->error = 0;\n    rn = getrn(lh, data, &hash);\n    if (*rn == NULL) {\n        lh->num_no_delete++;\n        return (NULL);\n    } else {\n        nn = *rn;\n        *rn = nn->next;\n        ret = nn->data;\n        OPENSSL_free(nn);\n        lh->num_delete++;\n    }\n    lh->num_items--;\n    if ((lh->num_nodes > MIN_NODES) &&\n        (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)))\n        contract(lh);\n    return (ret);\n}']