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


ssl/bio_ssl.c:489:10: Call
487.       if ((tdata->ssl == NULL) || (fdata->ssl == NULL))
488.           return 0;
489.       if (!SSL_copy_session_id(tdata->ssl, (fdata->ssl)))
                ^
490.           return 0;
491.       return 1;

ssl/ssl_lib.c:1550:1: Parameter `t->session_ctx->sessions->num_items`
  1548.    * modify.  We need to be able to read f without being hassled
  1549.    */
  1550. > int SSL_copy_session_id(SSL *t, const SSL *f)
  1551.   {
  1552.       int i;

ssl/ssl_lib.c:1554:10: Call
  1552.       int i;
  1553.       /* Do we need to to SSL locking? */
  1554.       if (!SSL_set_session(t, SSL_get_session(f))) {
                   ^
  1555.           return 0;
  1556.       }

ssl/ssl_sess.c:840:1: Parameter `s->session_ctx->sessions->num_items`
    838.   }
    839.   
    840. > int SSL_set_session(SSL *s, SSL_SESSION *session)
    841.   {
    842.       ssl_clear_bad_session(s);

ssl/ssl_sess.c:842:5: Call
    840.   int SSL_set_session(SSL *s, SSL_SESSION *session)
    841.   {
    842.       ssl_clear_bad_session(s);
               ^
    843.       if (s->ctx->method != s->method) {
    844.           if (!SSL_set_ssl_method(s, s->ctx->method))

ssl/ssl_sess.c:1135:1: Parameter `s->session_ctx->sessions->num_items`
      1133.   }
      1134.   
      1135. > int ssl_clear_bad_session(SSL *s)
      1136.   {
      1137.       if ((s->session != NULL) &&

ssl/ssl_sess.c:1140:9: Call
      1138.           !(s->shutdown & SSL_SENT_SHUTDOWN) &&
      1139.           !(SSL_in_init(s) || SSL_in_before(s))) {
      1140.           SSL_CTX_remove_session(s->session_ctx, s->session);
                      ^
      1141.           return 1;
      1142.       } else

ssl/ssl_sess.c:751:1: Parameter `ctx->sessions->num_items`
        749.   }
        750.   
        751. > int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c)
        752.   {
        753.       return remove_session_lock(ctx, c, 1);

ssl/ssl_sess.c:753:12: Call
        751.   int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c)
        752.   {
        753.       return remove_session_lock(ctx, c, 1);
                          ^
        754.   }
        755.   

ssl/ssl_sess.c:756:1: Parameter `ctx->sessions->num_items`
          754.   }
          755.   
          756. > static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck)
          757.   {
          758.       SSL_SESSION *r;

ssl/ssl_sess.c:766:17: Call
          764.           if ((r = lh_SSL_SESSION_retrieve(ctx->sessions, c)) != NULL) {
          765.               ret = 1;
          766.               r = lh_SSL_SESSION_delete(ctx->sessions, r);
                                 ^
          767.               SSL_SESSION_list_remove(ctx, r);
          768.           }

ssl/ssl_locl.h:732:1: Parameter `lh->num_items`
            730.   } TLSEXT_INDEX;
            731.   
            732. > DEFINE_LHASH_OF(SSL_SESSION);
            733.   /* Needed in ssl_cert.c */
            734.   DEFINE_LHASH_OF(X509_NAME);

ssl/ssl_locl.h:732:1: Call
            730.   } TLSEXT_INDEX;
            731.   
            732. > DEFINE_LHASH_OF(SSL_SESSION);
            733.   /* Needed in ssl_cert.c */
            734.   DEFINE_LHASH_OF(X509_NAME);

crypto/lhash/lhash.c:119:1: <LHS trace>
117.   }
118.   
119. > void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data)
120.   {
121.       unsigned long hash;

crypto/lhash/lhash.c:119:1: Parameter `lh->num_items`
              117.   }
              118.   
              119. > void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data)
              120.   {
              121.       unsigned long hash;

crypto/lhash/lhash.c:139:5: Binary operation: ([0, +oo] - 1):unsigned64 by call to `SSL_copy_session_id` 
              137.       }
              138.   
              139.       lh->num_items--;
                         ^
              140.       if ((lh->num_nodes > MIN_NODES) &&
              141.           (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)))

void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data)
{
    unsigned long hash;
    OPENSSL_LH_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 BIO_ssl_copy_session_id(BIO *t, BIO *f)\n{\n    BIO_SSL *tdata, *fdata;\n    t = BIO_find_type(t, BIO_TYPE_SSL);\n    f = BIO_find_type(f, BIO_TYPE_SSL);\n    if ((t == NULL) || (f == NULL))\n        return 0;\n    tdata = BIO_get_data(t);\n    fdata = BIO_get_data(f);\n    if ((tdata->ssl == NULL) || (fdata->ssl == NULL))\n        return 0;\n    if (!SSL_copy_session_id(tdata->ssl, (fdata->ssl)))\n        return 0;\n    return 1;\n}', 'int SSL_copy_session_id(SSL *t, const SSL *f)\n{\n    int i;\n    if (!SSL_set_session(t, SSL_get_session(f))) {\n        return 0;\n    }\n    if (t->method != f->method) {\n        t->method->ssl_free(t);\n        t->method = f->method;\n        if (t->method->ssl_new(t) == 0)\n            return 0;\n    }\n    CRYPTO_UP_REF(&f->cert->references, &i, f->cert->lock);\n    ssl_cert_free(t->cert);\n    t->cert = f->cert;\n    if (!SSL_set_session_id_context(t, f->sid_ctx, (int)f->sid_ctx_length)) {\n        return 0;\n    }\n    return 1;\n}', 'int SSL_set_session(SSL *s, SSL_SESSION *session)\n{\n    ssl_clear_bad_session(s);\n    if (s->ctx->method != s->method) {\n        if (!SSL_set_ssl_method(s, s->ctx->method))\n            return 0;\n    }\n    if (session != NULL) {\n        SSL_SESSION_up_ref(session);\n        s->verify_result = session->verify_result;\n    }\n    SSL_SESSION_free(s->session);\n    s->session = session;\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->session_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_THREAD_write_lock(ctx->lock);\n        if ((r = lh_SSL_SESSION_retrieve(ctx->sessions, c)) != NULL) {\n            ret = 1;\n            r = lh_SSL_SESSION_delete(ctx->sessions, r);\n            SSL_SESSION_list_remove(ctx, r);\n        }\n        c->not_resumable = 1;\n        if (lck)\n            CRYPTO_THREAD_unlock(ctx->lock);\n        if (ret)\n            SSL_SESSION_free(r);\n        if (ctx->remove_session_cb != NULL)\n            ctx->remove_session_cb(ctx, c);\n    } else\n        ret = 0;\n    return ret;\n}', 'DEFINE_LHASH_OF(SSL_SESSION)', 'void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data)\n{\n    unsigned long hash;\n    OPENSSL_LH_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}']