ssl/statem/statem_srvr.c:1335: error: INTEGER_OVERFLOW_L2
  ([0, max(0, `s->ctx->sessions->num_items`)] - 1):unsigned64 by call to `ssl_parse_clienthello_tlsext`.
Showing all 13 steps of the trace


ssl/statem/statem_srvr.c:964:1: Parameter `s->ctx->sessions->num_items`
962.   }
963.   
964. > MSG_PROCESS_RETURN tls_process_client_hello(SSL *s, PACKET *pkt)
965.   {
966.       int i, al = SSL_AD_INTERNAL_ERROR;

ssl/statem/statem_srvr.c:1335:14: Call
1333.       /* TLS extensions */
1334.       if (s->version >= SSL3_VERSION) {
1335.           if (!ssl_parse_clienthello_tlsext(s, &extensions)) {
                     ^
1336.               SSLerr(SSL_F_TLS_PROCESS_CLIENT_HELLO, SSL_R_PARSE_TLSEXT);
1337.               goto err;

ssl/t1_lib.c:2312:1: Parameter `s->ctx->sessions->num_items`
  2310.   }
  2311.   
  2312. > int ssl_parse_clienthello_tlsext(SSL *s, PACKET *pkt)
  2313.   {
  2314.       int al = -1;

ssl/t1_lib.c:2317:9: Call
  2315.       custom_ext_init(&s->cert->srv_ext);
  2316.       if (ssl_scan_clienthello_tlsext(s, pkt, &al) <= 0) {
  2317.           ssl3_send_alert(s, SSL3_AL_FATAL, al);
                  ^
  2318.           return 0;
  2319.       }

ssl/s3_msg.c:166:1: Parameter `s->ctx->sessions->num_items`
    164.   }
    165.   
    166. > int ssl3_send_alert(SSL *s, int level, int desc)
    167.   {
    168.       /* Map tls/ssl alert value to correct one */

ssl/s3_msg.c:177:9: Call
    175.       /* If a fatal one, remove from cache */
    176.       if ((level == SSL3_AL_FATAL) && (s->session != NULL))
    177.           SSL_CTX_remove_session(s->ctx, s->session);
                   ^
    178.   
    179.       s->s3->alert_dispatch = 1;

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

ssl/ssl_sess.c:787:12: Call
      785.   int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c)
      786.   {
      787.       return remove_session_lock(ctx, c, 1);
                        ^
      788.   }
      789.   

ssl/ssl_sess.c:790:1: Parameter `ctx->sessions->num_items`
        788.   }
        789.   
        790. > static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck)
        791.   {
        792.       SSL_SESSION *r;

ssl/ssl_sess.c:800:17: Call
        798.           if ((r = lh_SSL_SESSION_retrieve(ctx->sessions, c)) == c) {
        799.               ret = 1;
        800.               r = lh_SSL_SESSION_delete(ctx->sessions, c);
                               ^
        801.               SSL_SESSION_list_remove(ctx, c);
        802.           }

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, max(0, s->ctx->sessions->num_items)] - 1):unsigned64 by call to `ssl_parse_clienthello_tlsext` 
          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);
}
['MSG_PROCESS_RETURN tls_process_client_hello(SSL *s, PACKET *pkt)\n{\n    int i, al = SSL_AD_INTERNAL_ERROR;\n    unsigned int j, complen = 0;\n    unsigned long id;\n    SSL_CIPHER *c;\n#ifndef OPENSSL_NO_COMP\n    SSL_COMP *comp = NULL;\n#endif\n    STACK_OF(SSL_CIPHER) *ciphers = NULL;\n    int protverr = 1;\n    PACKET session_id, cipher_suites, compression, extensions, cookie;\n    int is_v2_record;\n    is_v2_record = RECORD_LAYER_is_sslv2_record(&s->rlayer);\n    PACKET_null_init(&cookie);\n    if (is_v2_record) {\n        unsigned int version;\n        unsigned int mt;\n        if (!PACKET_get_1(pkt, &mt)\n                || mt != SSL2_MT_CLIENT_HELLO) {\n            SSLerr(SSL_F_TLS_PROCESS_CLIENT_HELLO, ERR_R_INTERNAL_ERROR);\n            goto err;\n        }\n        if (!PACKET_get_net_2(pkt, &version)) {\n            SSLerr(SSL_F_TLS_PROCESS_CLIENT_HELLO, SSL_R_UNKNOWN_PROTOCOL);\n            goto err;\n        }\n        if (version == 0x0002) {\n            SSLerr(SSL_F_TLS_PROCESS_CLIENT_HELLO, SSL_R_UNKNOWN_PROTOCOL);\n            goto err;\n        } else if ((version & 0xff00) == (SSL3_VERSION_MAJOR << 8)) {\n            s->client_version = version;\n        } else {\n            SSLerr(SSL_F_TLS_PROCESS_CLIENT_HELLO, SSL_R_UNKNOWN_PROTOCOL);\n            goto err;\n        }\n    } else {\n        if(!PACKET_get_net_2(pkt, (unsigned int *)&s->client_version)) {\n            al = SSL_AD_DECODE_ERROR;\n            SSLerr(SSL_F_TLS_PROCESS_CLIENT_HELLO, SSL_R_LENGTH_TOO_SHORT);\n            goto f_err;\n        }\n    }\n    if (!SSL_IS_DTLS(s)) {\n        if (s->version != TLS_ANY_VERSION) {\n            if (s->client_version >= s->version) {\n                protverr = 0;\n            }\n        } else if (s->client_version >= SSL3_VERSION) {\n            switch(s->client_version) {\n            default:\n            case TLS1_2_VERSION:\n                if(!(s->options & SSL_OP_NO_TLSv1_2)) {\n                    s->version = TLS1_2_VERSION;\n                    s->method = TLSv1_2_server_method();\n                    protverr = 0;\n                    break;\n                }\n            case TLS1_1_VERSION:\n                if(!(s->options & SSL_OP_NO_TLSv1_1)) {\n                    s->version = TLS1_1_VERSION;\n                    s->method = TLSv1_1_server_method();\n                    protverr = 0;\n                    break;\n                }\n            case TLS1_VERSION:\n                if(!(s->options & SSL_OP_NO_TLSv1)) {\n                    s->version = TLS1_VERSION;\n                    s->method = TLSv1_server_method();\n                    protverr = 0;\n                    break;\n                }\n            case SSL3_VERSION:\n#ifndef OPENSSL_NO_SSL3\n                if(!(s->options & SSL_OP_NO_SSLv3)) {\n                    s->version = SSL3_VERSION;\n                    s->method = SSLv3_server_method();\n                    protverr = 0;\n                    break;\n                }\n#else\n                break;\n#endif\n            }\n        }\n    } else if (s->client_version <= s->version\n                || s->method->version == DTLS_ANY_VERSION) {\n        protverr = 0;\n    }\n    if (protverr) {\n        SSLerr(SSL_F_TLS_PROCESS_CLIENT_HELLO, SSL_R_UNKNOWN_PROTOCOL);\n        if ((!s->enc_write_ctx && !s->write_hash)) {\n            s->version = s->client_version;\n        }\n        al = SSL_AD_PROTOCOL_VERSION;\n        goto f_err;\n    }\n    if (is_v2_record) {\n        unsigned int cipher_len, session_id_len, challenge_len;\n        PACKET challenge;\n        if (!PACKET_get_net_2(pkt, &cipher_len)\n                || !PACKET_get_net_2(pkt, &session_id_len)\n                || !PACKET_get_net_2(pkt, &challenge_len)) {\n            SSLerr(SSL_F_TLS_PROCESS_CLIENT_HELLO,\n                   SSL_R_RECORD_LENGTH_MISMATCH);\n            al = SSL_AD_DECODE_ERROR;\n            goto f_err;\n        }\n        if (!PACKET_get_sub_packet(pkt, &cipher_suites, cipher_len)\n            || !PACKET_get_sub_packet(pkt, &session_id, session_id_len)\n            || !PACKET_get_sub_packet(pkt, &challenge, challenge_len)\n            || PACKET_remaining(pkt) != 0) {\n            SSLerr(SSL_F_TLS_PROCESS_CLIENT_HELLO,\n                   SSL_R_RECORD_LENGTH_MISMATCH);\n            al = SSL_AD_DECODE_ERROR;\n            goto f_err;\n        }\n        challenge_len = challenge_len > SSL3_RANDOM_SIZE ? SSL3_RANDOM_SIZE :\n            challenge_len;\n        memset(s->s3->client_random, 0, SSL3_RANDOM_SIZE);\n        if (!PACKET_copy_bytes(&challenge,\n                               s->s3->client_random + SSL3_RANDOM_SIZE -\n                               challenge_len, challenge_len)) {\n            SSLerr(SSL_F_TLS_PROCESS_CLIENT_HELLO, ERR_R_INTERNAL_ERROR);\n            al = SSL_AD_INTERNAL_ERROR;\n            goto f_err;\n        }\n        PACKET_null_init(&compression);\n        PACKET_null_init(&extensions);\n    } else {\n        if (!PACKET_copy_bytes(pkt, s->s3->client_random, SSL3_RANDOM_SIZE)\n            || !PACKET_get_length_prefixed_1(pkt, &session_id)) {\n            al = SSL_AD_DECODE_ERROR;\n            SSLerr(SSL_F_TLS_PROCESS_CLIENT_HELLO, SSL_R_LENGTH_MISMATCH);\n            goto f_err;\n        }\n        if (SSL_IS_DTLS(s)) {\n            if (!PACKET_get_length_prefixed_1(pkt, &cookie)) {\n                al = SSL_AD_DECODE_ERROR;\n                SSLerr(SSL_F_TLS_PROCESS_CLIENT_HELLO, SSL_R_LENGTH_MISMATCH);\n                goto f_err;\n            }\n            if (SSL_get_options(s) & SSL_OP_COOKIE_EXCHANGE) {\n                if (PACKET_remaining(&cookie) == 0)\n                return 1;\n            }\n        }\n        if (!PACKET_get_length_prefixed_2(pkt, &cipher_suites)\n            || !PACKET_get_length_prefixed_1(pkt, &compression)) {\n                al = SSL_AD_DECODE_ERROR;\n                SSLerr(SSL_F_TLS_PROCESS_CLIENT_HELLO, SSL_R_LENGTH_MISMATCH);\n                goto f_err;\n        }\n        extensions = *pkt;\n    }\n    s->hit = 0;\n    if (is_v2_record ||\n        (s->new_session &&\n         (s->options & SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION))) {\n        if (!ssl_get_new_session(s, 1))\n            goto err;\n    } else {\n        i = ssl_get_prev_session(s, &extensions, &session_id);\n        if (i == 1 && s->version == s->session->ssl_version) {\n            s->hit = 1;\n        } else if (i == -1) {\n            goto err;\n        } else {\n            if (!ssl_get_new_session(s, 1))\n                goto err;\n        }\n    }\n    if (SSL_IS_DTLS(s)) {\n        if (SSL_get_options(s) & SSL_OP_COOKIE_EXCHANGE) {\n            if (s->ctx->app_verify_cookie_cb != NULL) {\n                if (s->ctx->app_verify_cookie_cb(s, PACKET_data(&cookie),\n                                                 PACKET_remaining(&cookie)) == 0) {\n                    al = SSL_AD_HANDSHAKE_FAILURE;\n                    SSLerr(SSL_F_TLS_PROCESS_CLIENT_HELLO,\n                           SSL_R_COOKIE_MISMATCH);\n                    goto f_err;\n                }\n            } else if (!PACKET_equal(&cookie, s->d1->cookie,\n                                     s->d1->cookie_len)) {\n                al = SSL_AD_HANDSHAKE_FAILURE;\n                SSLerr(SSL_F_TLS_PROCESS_CLIENT_HELLO, SSL_R_COOKIE_MISMATCH);\n                goto f_err;\n            }\n            s->d1->cookie_verified = 1;\n        }\n        if (s->method->version == DTLS_ANY_VERSION) {\n            if (s->client_version <= DTLS1_2_VERSION &&\n                !(s->options & SSL_OP_NO_DTLSv1_2)) {\n                s->version = DTLS1_2_VERSION;\n                s->method = DTLSv1_2_server_method();\n            } else if (tls1_suiteb(s)) {\n                SSLerr(SSL_F_TLS_PROCESS_CLIENT_HELLO,\n                       SSL_R_ONLY_DTLS_1_2_ALLOWED_IN_SUITEB_MODE);\n                s->version = s->client_version;\n                al = SSL_AD_PROTOCOL_VERSION;\n                goto f_err;\n            } else if (s->client_version <= DTLS1_VERSION &&\n                       !(s->options & SSL_OP_NO_DTLSv1)) {\n                s->version = DTLS1_VERSION;\n                s->method = DTLSv1_server_method();\n            } else {\n                SSLerr(SSL_F_TLS_PROCESS_CLIENT_HELLO,\n                       SSL_R_WRONG_VERSION_NUMBER);\n                s->version = s->client_version;\n                al = SSL_AD_PROTOCOL_VERSION;\n                goto f_err;\n            }\n            s->session->ssl_version = s->version;\n        }\n    }\n    if (ssl_bytes_to_cipher_list(s, &cipher_suites, &(ciphers),\n                                 is_v2_record, &al) == NULL) {\n        goto f_err;\n    }\n    if (s->hit) {\n        j = 0;\n        id = s->session->cipher->id;\n#ifdef CIPHER_DEBUG\n        fprintf(stderr, "client sent %d ciphers\\n",\n                sk_SSL_CIPHER_num(ciphers));\n#endif\n        for (i = 0; i < sk_SSL_CIPHER_num(ciphers); i++) {\n            c = sk_SSL_CIPHER_value(ciphers, i);\n#ifdef CIPHER_DEBUG\n            fprintf(stderr, "client [%2d of %2d]:%s\\n",\n                    i, sk_SSL_CIPHER_num(ciphers), SSL_CIPHER_get_name(c));\n#endif\n            if (c->id == id) {\n                j = 1;\n                break;\n            }\n        }\n        if (j == 0) {\n            al = SSL_AD_ILLEGAL_PARAMETER;\n            SSLerr(SSL_F_TLS_PROCESS_CLIENT_HELLO,\n                   SSL_R_REQUIRED_CIPHER_MISSING);\n            goto f_err;\n        }\n    }\n    complen = PACKET_remaining(&compression);\n    for (j = 0; j < complen; j++) {\n        if (PACKET_data(&compression)[j] == 0)\n            break;\n    }\n    if (j >= complen) {\n        al = SSL_AD_DECODE_ERROR;\n        SSLerr(SSL_F_TLS_PROCESS_CLIENT_HELLO, SSL_R_NO_COMPRESSION_SPECIFIED);\n        goto f_err;\n    }\n    if (s->version >= SSL3_VERSION) {\n        if (!ssl_parse_clienthello_tlsext(s, &extensions)) {\n            SSLerr(SSL_F_TLS_PROCESS_CLIENT_HELLO, SSL_R_PARSE_TLSEXT);\n            goto err;\n        }\n    }\n    {\n        unsigned char *pos;\n        pos = s->s3->server_random;\n        if (ssl_fill_hello_random(s, 1, pos, SSL3_RANDOM_SIZE) <= 0) {\n            goto f_err;\n        }\n    }\n    if (!s->hit && s->version >= TLS1_VERSION && s->tls_session_secret_cb) {\n        SSL_CIPHER *pref_cipher = NULL;\n        s->session->master_key_length = sizeof(s->session->master_key);\n        if (s->tls_session_secret_cb(s, s->session->master_key,\n                                     &s->session->master_key_length, ciphers,\n                                     &pref_cipher,\n                                     s->tls_session_secret_cb_arg)) {\n            s->hit = 1;\n            s->session->ciphers = ciphers;\n            s->session->verify_result = X509_V_OK;\n            ciphers = NULL;\n            pref_cipher =\n                pref_cipher ? pref_cipher : ssl3_choose_cipher(s,\n                                                               s->\n                                                               session->ciphers,\n                                                               SSL_get_ciphers\n                                                               (s));\n            if (pref_cipher == NULL) {\n                al = SSL_AD_HANDSHAKE_FAILURE;\n                SSLerr(SSL_F_TLS_PROCESS_CLIENT_HELLO, SSL_R_NO_SHARED_CIPHER);\n                goto f_err;\n            }\n            s->session->cipher = pref_cipher;\n            sk_SSL_CIPHER_free(s->cipher_list);\n            s->cipher_list = sk_SSL_CIPHER_dup(s->session->ciphers);\n            sk_SSL_CIPHER_free(s->cipher_list_by_id);\n            s->cipher_list_by_id = sk_SSL_CIPHER_dup(s->session->ciphers);\n        }\n    }\n    s->s3->tmp.new_compression = NULL;\n#ifndef OPENSSL_NO_COMP\n    if (s->session->compress_meth != 0) {\n        int m, comp_id = s->session->compress_meth;\n        unsigned int k;\n        if (!ssl_allow_compression(s)) {\n            SSLerr(SSL_F_TLS_PROCESS_CLIENT_HELLO,\n                   SSL_R_INCONSISTENT_COMPRESSION);\n            goto f_err;\n        }\n        for (m = 0; m < sk_SSL_COMP_num(s->ctx->comp_methods); m++) {\n            comp = sk_SSL_COMP_value(s->ctx->comp_methods, m);\n            if (comp_id == comp->id) {\n                s->s3->tmp.new_compression = comp;\n                break;\n            }\n        }\n        if (s->s3->tmp.new_compression == NULL) {\n            SSLerr(SSL_F_TLS_PROCESS_CLIENT_HELLO,\n                   SSL_R_INVALID_COMPRESSION_ALGORITHM);\n            goto f_err;\n        }\n        for (k = 0; k < complen; k++) {\n            if (PACKET_data(&compression)[k] == comp_id)\n                break;\n        }\n        if (k >= complen) {\n            al = SSL_AD_ILLEGAL_PARAMETER;\n            SSLerr(SSL_F_TLS_PROCESS_CLIENT_HELLO,\n                   SSL_R_REQUIRED_COMPRESSSION_ALGORITHM_MISSING);\n            goto f_err;\n        }\n    } else if (s->hit)\n        comp = NULL;\n    else if (ssl_allow_compression(s) && s->ctx->comp_methods) {\n        int m, nn, v, done = 0;\n        unsigned int o;\n        nn = sk_SSL_COMP_num(s->ctx->comp_methods);\n        for (m = 0; m < nn; m++) {\n            comp = sk_SSL_COMP_value(s->ctx->comp_methods, m);\n            v = comp->id;\n            for (o = 0; o < complen; o++) {\n                if (v == PACKET_data(&compression)[o]) {\n                    done = 1;\n                    break;\n                }\n            }\n            if (done)\n                break;\n        }\n        if (done)\n            s->s3->tmp.new_compression = comp;\n        else\n            comp = NULL;\n    }\n#else\n    if (s->session->compress_meth != 0) {\n        SSLerr(SSL_F_TLS_PROCESS_CLIENT_HELLO, SSL_R_INCONSISTENT_COMPRESSION);\n        goto f_err;\n    }\n#endif\n    if (!s->hit) {\n#ifdef OPENSSL_NO_COMP\n        s->session->compress_meth = 0;\n#else\n        s->session->compress_meth = (comp == NULL) ? 0 : comp->id;\n#endif\n        sk_SSL_CIPHER_free(s->session->ciphers);\n        s->session->ciphers = ciphers;\n        if (ciphers == NULL) {\n            al = SSL_AD_INTERNAL_ERROR;\n            SSLerr(SSL_F_TLS_PROCESS_CLIENT_HELLO, ERR_R_INTERNAL_ERROR);\n            goto f_err;\n        }\n        ciphers = NULL;\n        if (!tls1_set_server_sigalgs(s)) {\n            SSLerr(SSL_F_TLS_PROCESS_CLIENT_HELLO, SSL_R_CLIENTHELLO_TLSEXT);\n            goto err;\n        }\n    }\n    sk_SSL_CIPHER_free(ciphers);\n    return MSG_PROCESS_CONTINUE_PROCESSING;\n f_err:\n    ssl3_send_alert(s, SSL3_AL_FATAL, al);\n err:\n    ossl_statem_set_error(s);\n    sk_SSL_CIPHER_free(ciphers);\n    return MSG_PROCESS_ERROR;\n}', 'int ssl_parse_clienthello_tlsext(SSL *s, PACKET *pkt)\n{\n    int al = -1;\n    custom_ext_init(&s->cert->srv_ext);\n    if (ssl_scan_clienthello_tlsext(s, pkt, &al) <= 0) {\n        ssl3_send_alert(s, SSL3_AL_FATAL, al);\n        return 0;\n    }\n    if (ssl_check_clienthello_tlsext_early(s) <= 0) {\n        SSLerr(SSL_F_SSL_PARSE_CLIENTHELLO_TLSEXT, SSL_R_CLIENTHELLO_TLSEXT);\n        return 0;\n    }\n    return 1;\n}', 'int ssl3_send_alert(SSL *s, int level, int desc)\n{\n    desc = s->method->ssl3_enc->alert_value(desc);\n    if (s->version == SSL3_VERSION && desc == SSL_AD_PROTOCOL_VERSION)\n        desc = SSL_AD_HANDSHAKE_FAILURE;\n    if (desc < 0)\n        return -1;\n    if ((level == SSL3_AL_FATAL) && (s->session != NULL))\n        SSL_CTX_remove_session(s->ctx, s->session);\n    s->s3->alert_dispatch = 1;\n    s->s3->send_alert[0] = level;\n    s->s3->send_alert[1] = desc;\n    if (!RECORD_LAYER_write_pending(&s->rlayer)) {\n        return s->method->ssl_dispatch_alert(s);\n    }\n    return -1;\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}']