ssl/bio_ssl.c:126: error: INTEGER_OVERFLOW_L2
  ([0, +oo] - 1):unsigned64 by call to `SSL_free`.
Showing all 14 steps of the trace


ssl/bio_ssl.c:126:13: Call
124.       if (a->shutdown) {
125.           if (a->init)
126.               SSL_free(bs->ssl);
                   ^
127.           a->init = 0;
128.           a->flags = 0;

ssl/ssl_lib.c:989:1: Parameter `s->ctx->sessions->num_items`
  987.   }
  988.   
  989. > void SSL_free(SSL *s)
  990.   {
  991.       int i;

ssl/ssl_lib.c:1033:9: Call
  1031.       /* Make the next call work :-) */
  1032.       if (s->session != NULL) {
  1033.           ssl_clear_bad_session(s);
                  ^
  1034.           SSL_SESSION_free(s->session);
  1035.       }

ssl/ssl_sess.c:1078:1: Parameter `s->ctx->sessions->num_items`
    1076.   }
    1077.   
    1078. > int ssl_clear_bad_session(SSL *s)
    1079.   {
    1080.       if ((s->session != NULL) &&

ssl/ssl_sess.c:1083:9: Call
    1081.           !(s->shutdown & SSL_SENT_SHUTDOWN) &&
    1082.           !(SSL_in_init(s) || SSL_in_before(s))) {
    1083.           SSL_CTX_remove_session(s->ctx, s->session);
                    ^
    1084.           return (1);
    1085.       } else

ssl/ssl_sess.c:780:1: Parameter `ctx->sessions->num_items`
      778.   }
      779.   
      780. > int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c)
      781.   {
      782.       return remove_session_lock(ctx, c, 1);

ssl/ssl_sess.c:782:12: Call
      780.   int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c)
      781.   {
      782.       return remove_session_lock(ctx, c, 1);
                        ^
      783.   }
      784.   

ssl/ssl_sess.c:785:1: Parameter `ctx->sessions->num_items`
        783.   }
        784.   
        785. > static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck)
        786.   {
        787.       SSL_SESSION *r;

ssl/ssl_sess.c:795:17: Call
        793.           if ((r = lh_SSL_SESSION_retrieve(ctx->sessions, c)) == c) {
        794.               ret = 1;
        795.               r = lh_SSL_SESSION_delete(ctx->sessions, c);
                               ^
        796.               SSL_SESSION_list_remove(ctx, c);
        797.           }

ssl/ssl_locl.h:693:1: Parameter `lh->num_items`
          691.   };
          692.   
          693. > DEFINE_LHASH_OF(SSL_SESSION);
          694.   
          695.   

ssl/ssl_locl.h:693:1: Call
          691.   };
          692.   
          693. > DEFINE_LHASH_OF(SSL_SESSION);
          694.   
          695.   

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

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

crypto/lhash/lhash.c:208:5: Binary operation: ([0, +oo] - 1):unsigned64 by call to `SSL_free` 
            206.       }
            207.   
            208.       lh->num_items--;
                       ^
            209.       if ((lh->num_nodes > MIN_NODES) &&
            210.           (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);
}
['static int ssl_free(BIO *a)\n{\n    BIO_SSL *bs;\n    if (a == NULL)\n        return (0);\n    bs = (BIO_SSL *)a->ptr;\n    if (bs->ssl != NULL)\n        SSL_shutdown(bs->ssl);\n    if (a->shutdown) {\n        if (a->init)\n            SSL_free(bs->ssl);\n        a->init = 0;\n        a->flags = 0;\n    }\n    OPENSSL_free(a->ptr);\n    return (1);\n}', 'void SSL_free(SSL *s)\n{\n    int i;\n    if (s == NULL)\n        return;\n    i = CRYPTO_add(&s->references, -1, CRYPTO_LOCK_SSL);\n#ifdef REF_PRINT\n    REF_PRINT("SSL", s);\n#endif\n    if (i > 0)\n        return;\n#ifdef REF_CHECK\n    if (i < 0) {\n        fprintf(stderr, "SSL_free, bad reference count\\n");\n        abort();\n    }\n#endif\n    X509_VERIFY_PARAM_free(s->param);\n    dane_final(&s->dane);\n    CRYPTO_free_ex_data(CRYPTO_EX_INDEX_SSL, s, &s->ex_data);\n    if (s->bbio != NULL) {\n        if (s->bbio == s->wbio) {\n            s->wbio = BIO_pop(s->wbio);\n        }\n        BIO_free(s->bbio);\n        s->bbio = NULL;\n    }\n    BIO_free_all(s->rbio);\n    if (s->wbio != s->rbio)\n        BIO_free_all(s->wbio);\n    BUF_MEM_free(s->init_buf);\n    sk_SSL_CIPHER_free(s->cipher_list);\n    sk_SSL_CIPHER_free(s->cipher_list_by_id);\n    if (s->session != NULL) {\n        ssl_clear_bad_session(s);\n        SSL_SESSION_free(s->session);\n    }\n    clear_ciphers(s);\n    ssl_cert_free(s->cert);\n    OPENSSL_free(s->tlsext_hostname);\n    SSL_CTX_free(s->initial_ctx);\n#ifndef OPENSSL_NO_EC\n    OPENSSL_free(s->tlsext_ecpointformatlist);\n    OPENSSL_free(s->tlsext_ellipticcurvelist);\n#endif\n    sk_X509_EXTENSION_pop_free(s->tlsext_ocsp_exts, X509_EXTENSION_free);\n    sk_OCSP_RESPID_pop_free(s->tlsext_ocsp_ids, OCSP_RESPID_free);\n    OPENSSL_free(s->tlsext_ocsp_resp);\n    OPENSSL_free(s->alpn_client_proto_list);\n    sk_X509_NAME_pop_free(s->client_CA, X509_NAME_free);\n    if (s->method != NULL)\n        s->method->ssl_free(s);\n    RECORD_LAYER_release(&s->rlayer);\n    SSL_CTX_free(s->ctx);\n#if !defined(OPENSSL_NO_NEXTPROTONEG)\n    OPENSSL_free(s->next_proto_negotiated);\n#endif\n#ifndef OPENSSL_NO_SRTP\n    sk_SRTP_PROTECTION_PROFILE_free(s->srtp_profiles);\n#endif\n    OPENSSL_free(s);\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}', 'DEFINE_LHASH_OF(SSL_SESSION)', '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}']