test/sslcorrupttest.c:173: error: INTEGER_OVERFLOW_L2
  ([0, 8] - 1):unsigned32 by call to `SSL_free`.
Showing all 18 steps of the trace


test/sslcorrupttest.c:147:10: Call
145.       int i, j, numciphers = 0;
146.   
147.       if (!TEST_ptr(ctx = SSL_CTX_new(TLS_server_method()))
                ^
148.               || !TEST_ptr(ssl = SSL_new(ctx))
149.               || !TEST_ptr(sk_ciphers = SSL_get1_supported_ciphers(ssl)))

ssl/ssl_lib.c:2652:21: Call
  2650.           goto err;
  2651.   
  2652.       ret->sessions = lh_SSL_SESSION_new(ssl_session_hash, ssl_session_cmp);
                              ^
  2653.       if (ret->sessions == NULL)
  2654.           goto err;

ssl/ssl_locl.h:696:1: Call
    694.   } TLSEXT_INDEX;
    695.   
    696. > DEFINE_LHASH_OF(SSL_SESSION);
    697.   /* Needed in ssl_cert.c */
    698.   DEFINE_LHASH_OF(X509_NAME);

crypto/lhash/lhash.c:39:5: Assignment
      37.       ret->comp = ((c == NULL) ? (OPENSSL_LH_COMPFUNC)strcmp : c);
      38.       ret->hash = ((h == NULL) ? (OPENSSL_LH_HASHFUNC)OPENSSL_LH_strhash : h);
      39.       ret->num_nodes = MIN_NODES / 2;
                ^
      40.       ret->num_alloc_nodes = MIN_NODES;
      41.       ret->pmax = MIN_NODES / 2;

test/sslcorrupttest.c:173:5: Call
171.   err:
172.       sk_SSL_CIPHER_free(sk_ciphers);
173.       SSL_free(ssl);
           ^
174.       SSL_CTX_free(ctx);
175.   

ssl/ssl_lib.c:942:1: Parameter `s->ctx->sessions->num_nodes`
  940.   }
  941.   
  942. > void SSL_free(SSL *s)
  943.   {
  944.       int i;

ssl/ssl_lib.c:1011:5: Call
  1009.       RECORD_LAYER_release(&s->rlayer);
  1010.   
  1011.       SSL_CTX_free(s->ctx);
              ^
  1012.   
  1013.       ASYNC_WAIT_CTX_free(s->waitctx);

ssl/ssl_lib.c:2769:1: Parameter `a->sessions->num_nodes`
    2767.   }
    2768.   
    2769. > void SSL_CTX_free(SSL_CTX *a)
    2770.   {
    2771.       int i;

ssl/ssl_lib.c:2795:9: Call
    2793.        */
    2794.       if (a->sessions != NULL)
    2795.           SSL_CTX_flush_sessions(a, 0);
                    ^
    2796.   
    2797.       CRYPTO_free_ex_data(CRYPTO_EX_INDEX_SSL_CTX, a, &a->ex_data);

ssl/ssl_sess.c:1025:1: Parameter `s->sessions->num_nodes`
      1023.   IMPLEMENT_LHASH_DOALL_ARG(SSL_SESSION, TIMEOUT_PARAM);
      1024.   
      1025. > void SSL_CTX_flush_sessions(SSL_CTX *s, long t)
      1026.   {
      1027.       unsigned long i;

ssl/ssl_sess.c:1038:5: Call
      1036.       i = lh_SSL_SESSION_get_down_load(s->sessions);
      1037.       lh_SSL_SESSION_set_down_load(s->sessions, 0);
      1038.       lh_SSL_SESSION_doall_TIMEOUT_PARAM(tp.cache, timeout_cb, &tp);
                  ^
      1039.       lh_SSL_SESSION_set_down_load(s->sessions, i);
      1040.       CRYPTO_THREAD_unlock(s->lock);

ssl/ssl_sess.c:1023:1: Parameter `lh->num_nodes`
        1021.   }
        1022.   
        1023. > IMPLEMENT_LHASH_DOALL_ARG(SSL_SESSION, TIMEOUT_PARAM);
        1024.   
        1025.   void SSL_CTX_flush_sessions(SSL_CTX *s, long t)

ssl/ssl_sess.c:1023:1: Call
        1021.   }
        1022.   
        1023. > IMPLEMENT_LHASH_DOALL_ARG(SSL_SESSION, TIMEOUT_PARAM);
        1024.   
        1025.   void SSL_CTX_flush_sessions(SSL_CTX *s, long t)

crypto/lhash/lhash.c:186:1: Parameter `lh->num_nodes`
          184.   }
          185.   
          186. > void OPENSSL_LH_doall_arg(OPENSSL_LHASH *lh, OPENSSL_LH_DOALL_FUNCARG func, void *arg)
          187.   {
          188.       doall_util_fn(lh, 1, (OPENSSL_LH_DOALL_FUNC)0, func, arg);

crypto/lhash/lhash.c:188:5: Call
          186.   void OPENSSL_LH_doall_arg(OPENSSL_LHASH *lh, OPENSSL_LH_DOALL_FUNCARG func, void *arg)
          187.   {
          188.       doall_util_fn(lh, 1, (OPENSSL_LH_DOALL_FUNC)0, func, arg);
                     ^
          189.   }
          190.   

crypto/lhash/lhash.c:154:1: <LHS trace>
152.   }
153.   
154. > static void doall_util_fn(OPENSSL_LHASH *lh, int use_arg,
155.                             OPENSSL_LH_DOALL_FUNC func,
156.                             OPENSSL_LH_DOALL_FUNCARG func_arg, void *arg)

crypto/lhash/lhash.c:154:1: Parameter `lh->num_nodes`
            152.   }
            153.   
            154. > static void doall_util_fn(OPENSSL_LHASH *lh, int use_arg,
            155.                             OPENSSL_LH_DOALL_FUNC func,
            156.                             OPENSSL_LH_DOALL_FUNCARG func_arg, void *arg)

crypto/lhash/lhash.c:168:10: Binary operation: ([0, 8] - 1):unsigned32 by call to `SSL_free` 
            166.        * memory leaks otherwise
            167.        */
            168.       for (i = lh->num_nodes - 1; i >= 0; i--) {
                            ^
            169.           a = lh->b[i];
            170.           while (a != NULL) {
