ssl/statem/statem_srvr.c:1571: error: INTEGER_OVERFLOW_L2
  ([1, `s->clienthello->ciphersuites.remaining`] - [2, 3]):unsigned64 by call to `bytes_to_cipher_list`.
Showing all 13 steps of the trace


ssl/statem/statem_srvr.c:1454:1: Parameter `s->clienthello->ciphersuites.remaining`
1452.   }
1453.   
1454. > static int tls_early_post_process_client_hello(SSL *s, int *pal)
1455.   {
1456.       unsigned int j;

ssl/statem/statem_srvr.c:1569:10: Call
1567.       s->hit = 0;
1568.   
1569.       if (!ssl_cache_cipherlist(s, &clienthello->ciphersuites,
                 ^
1570.                                 clienthello->isv2, &al) ||
1571.           !bytes_to_cipher_list(s, &clienthello->ciphersuites, &ciphers, &scsvs,

ssl/ssl_lib.c:4751:1: Parameter `cipher_suites->remaining`
  4749.   #define SSLV2_CIPHER_LEN    3
  4750.   
  4751. > int ssl_cache_cipherlist(SSL *s, PACKET *cipher_suites, int sslv2format,
  4752.                            int *al)
  4753.   {

ssl/statem/statem_srvr.c:1571:10: Call
1569.       if (!ssl_cache_cipherlist(s, &clienthello->ciphersuites,
1570.                                 clienthello->isv2, &al) ||
1571.           !bytes_to_cipher_list(s, &clienthello->ciphersuites, &ciphers, &scsvs,
                 ^
1572.                                clienthello->isv2, &al)) {
1573.           goto err;

ssl/ssl_lib.c:4834:1: Parameter `cipher_suites->remaining`
  4832.   }
  4833.   
  4834. > int bytes_to_cipher_list(SSL *s, PACKET *cipher_suites,
  4835.                            STACK_OF(SSL_CIPHER) **skp,
  4836.                            STACK_OF(SSL_CIPHER) **scsvs_out,

ssl/ssl_lib.c:4869:12: Call
  4867.       }
  4868.   
  4869.       while (PACKET_copy_bytes(cipher_suites, cipher, n)) {
                     ^
  4870.           /*
  4871.            * SSLv3 ciphers wrapped in an SSLv2-compatible ClientHello have the

ssl/packet_locl.h:379:8: Parameter `len`
    377.    * The caller is responsible for ensuring that |data| can hold |len| bytes.
    378.    */
    379.   __owur static ossl_inline int PACKET_copy_bytes(PACKET *pkt,
                  ^
    380.                                                   unsigned char *data, size_t len)
    381.   {

ssl/packet_locl.h:385:5: Call
    383.           return 0;
    384.   
    385.       packet_forward(pkt, len);
               ^
    386.   
    387.       return 1;

ssl/packet_locl.h:33:1: <LHS trace>
31.   
32.   /* Internal unchecked shorthand; don't use outside this file. */
33. > static ossl_inline void packet_forward(PACKET *pkt, size_t len)
34.   {
35.       pkt->curr += len;

ssl/packet_locl.h:33:1: Parameter `pkt->remaining`
      31.   
      32.   /* Internal unchecked shorthand; don't use outside this file. */
      33. > static ossl_inline void packet_forward(PACKET *pkt, size_t len)
      34.   {
      35.       pkt->curr += len;

ssl/packet_locl.h:33:1: <RHS trace>
31.   
32.   /* Internal unchecked shorthand; don't use outside this file. */
33. > static ossl_inline void packet_forward(PACKET *pkt, size_t len)
34.   {
35.       pkt->curr += len;

ssl/packet_locl.h:33:1: Parameter `len`
      31.   
      32.   /* Internal unchecked shorthand; don't use outside this file. */
      33. > static ossl_inline void packet_forward(PACKET *pkt, size_t len)
      34.   {
      35.       pkt->curr += len;

ssl/packet_locl.h:36:5: Binary operation: ([1, s->clienthello->ciphersuites.remaining] - [2, 3]):unsigned64 by call to `bytes_to_cipher_list` 
      34.   {
      35.       pkt->curr += len;
      36.       pkt->remaining -= len;
                ^
      37.   }
      38.   

static ossl_inline void packet_forward(PACKET *pkt, size_t len)
{
    pkt->curr += len;
    pkt->remaining -= len;
}
['static int tls_early_post_process_client_hello(SSL *s, int *pal)\n{\n    unsigned int j;\n    int i, al = SSL_AD_INTERNAL_ERROR;\n    int protverr;\n    size_t loop;\n    unsigned long id;\n#ifndef OPENSSL_NO_COMP\n    SSL_COMP *comp = NULL;\n#endif\n    const SSL_CIPHER *c;\n    STACK_OF(SSL_CIPHER) *ciphers = NULL;\n    STACK_OF(SSL_CIPHER) *scsvs = NULL;\n    CLIENTHELLO_MSG *clienthello = s->clienthello;\n    DOWNGRADE dgrd = DOWNGRADE_NONE;\n    if (s->ctx->early_cb != NULL) {\n        int code;\n        code = s->ctx->early_cb(s, &al, s->ctx->early_cb_arg);\n        if (code == 0)\n            goto err;\n        if (code < 0) {\n            s->rwstate = SSL_EARLY_WORK;\n            return code;\n        }\n    }\n    memcpy(s->s3->client_random, clienthello->random, SSL3_RANDOM_SIZE);\n    if (clienthello->isv2) {\n        if (clienthello->legacy_version == SSL2_VERSION\n                || (clienthello->legacy_version & 0xff00)\n                   != (SSL3_VERSION_MAJOR << 8)) {\n            SSLerr(SSL_F_TLS_EARLY_POST_PROCESS_CLIENT_HELLO, SSL_R_UNKNOWN_PROTOCOL);\n            goto err;\n        }\n        s->client_version = clienthello->legacy_version;\n    }\n    if (!SSL_IS_DTLS(s)) {\n        protverr = ssl_choose_server_version(s, clienthello, &dgrd);\n    } else if (s->method->version != DTLS_ANY_VERSION &&\n               DTLS_VERSION_LT((int)clienthello->legacy_version, s->version)) {\n        protverr = SSL_R_VERSION_TOO_LOW;\n    } else {\n        protverr = 0;\n    }\n    if (protverr) {\n        SSLerr(SSL_F_TLS_EARLY_POST_PROCESS_CLIENT_HELLO, protverr);\n        if (SSL_IS_FIRST_HANDSHAKE(s)) {\n            s->version = s->client_version = clienthello->legacy_version;\n        }\n        al = SSL_AD_PROTOCOL_VERSION;\n        goto err;\n    }\n    if (SSL_IS_TLS13(s) && RECORD_LAYER_processed_read_pending(&s->rlayer)) {\n        al = SSL_AD_UNEXPECTED_MESSAGE;\n        SSLerr(SSL_F_TLS_EARLY_POST_PROCESS_CLIENT_HELLO,\n               SSL_R_NOT_ON_RECORD_BOUNDARY);\n        goto err;\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, clienthello->dtls_cookie,\n                        clienthello->dtls_cookie_len) == 0) {\n                    al = SSL_AD_HANDSHAKE_FAILURE;\n                    SSLerr(SSL_F_TLS_EARLY_POST_PROCESS_CLIENT_HELLO,\n                           SSL_R_COOKIE_MISMATCH);\n                    goto err;\n                }\n            } else if (s->d1->cookie_len != clienthello->dtls_cookie_len\n                    || memcmp(clienthello->dtls_cookie, s->d1->cookie,\n                              s->d1->cookie_len) != 0) {\n                al = SSL_AD_HANDSHAKE_FAILURE;\n                SSLerr(SSL_F_TLS_EARLY_POST_PROCESS_CLIENT_HELLO, SSL_R_COOKIE_MISMATCH);\n                goto err;\n            }\n            s->d1->cookie_verified = 1;\n        }\n        if (s->method->version == DTLS_ANY_VERSION) {\n            protverr = ssl_choose_server_version(s, clienthello, &dgrd);\n            if (protverr != 0) {\n                SSLerr(SSL_F_TLS_EARLY_POST_PROCESS_CLIENT_HELLO, protverr);\n                s->version = s->client_version;\n                al = SSL_AD_PROTOCOL_VERSION;\n                goto err;\n            }\n        }\n    }\n    s->hit = 0;\n    if (!ssl_cache_cipherlist(s, &clienthello->ciphersuites,\n                              clienthello->isv2, &al) ||\n        !bytes_to_cipher_list(s, &clienthello->ciphersuites, &ciphers, &scsvs,\n                             clienthello->isv2, &al)) {\n        goto err;\n    }\n    s->s3->send_connection_binding = 0;\n    if (scsvs != NULL) {\n        for(i = 0; i < sk_SSL_CIPHER_num(scsvs); i++) {\n            c = sk_SSL_CIPHER_value(scsvs, i);\n            if (SSL_CIPHER_get_id(c) == SSL3_CK_SCSV) {\n                if (s->renegotiate) {\n                    SSLerr(SSL_F_TLS_EARLY_POST_PROCESS_CLIENT_HELLO,\n                           SSL_R_SCSV_RECEIVED_WHEN_RENEGOTIATING);\n                    al = SSL_AD_HANDSHAKE_FAILURE;\n                    goto err;\n                }\n                s->s3->send_connection_binding = 1;\n            } else if (SSL_CIPHER_get_id(c) == SSL3_CK_FALLBACK_SCSV &&\n                       !ssl_check_version_downgrade(s)) {\n                SSLerr(SSL_F_TLS_EARLY_POST_PROCESS_CLIENT_HELLO,\n                       SSL_R_INAPPROPRIATE_FALLBACK);\n                al = SSL_AD_INAPPROPRIATE_FALLBACK;\n                goto err;\n            }\n        }\n    }\n    if (SSL_IS_TLS13(s)) {\n        const SSL_CIPHER *cipher =\n            ssl3_choose_cipher(s, ciphers, SSL_get_ciphers(s));\n        if (cipher == NULL) {\n            SSLerr(SSL_F_TLS_EARLY_POST_PROCESS_CLIENT_HELLO,\n                   SSL_R_NO_SHARED_CIPHER);\n            al = SSL_AD_HANDSHAKE_FAILURE;\n            goto err;\n        }\n        if (s->hello_retry_request\n                && (s->s3->tmp.new_cipher == NULL\n                    || s->s3->tmp.new_cipher->id != cipher->id)) {\n            al = SSL_AD_ILLEGAL_PARAMETER;\n            SSLerr(SSL_F_TLS_EARLY_POST_PROCESS_CLIENT_HELLO, SSL_R_BAD_CIPHER);\n            goto err;\n        }\n        s->s3->tmp.new_cipher = cipher;\n    }\n    if (!tls_parse_extension(s, TLSEXT_IDX_extended_master_secret,\n                             SSL_EXT_CLIENT_HELLO,\n                             clienthello->pre_proc_exts, NULL, 0, &al)) {\n        SSLerr(SSL_F_TLS_EARLY_POST_PROCESS_CLIENT_HELLO, SSL_R_CLIENTHELLO_TLSEXT);\n        goto err;\n    }\n    if (clienthello->isv2 ||\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, clienthello, &al);\n        if (i == 1) {\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_TLS13(s) && s->hit) {\n        j = 0;\n        id = s->session->cipher->id;\n#ifdef CIPHER_DEBUG\n        fprintf(stderr, "client sent %d ciphers\\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_EARLY_POST_PROCESS_CLIENT_HELLO,\n                   SSL_R_REQUIRED_CIPHER_MISSING);\n            goto err;\n        }\n    }\n    for (loop = 0; loop < clienthello->compressions_len; loop++) {\n        if (clienthello->compressions[loop] == 0)\n            break;\n    }\n    if (loop >= clienthello->compressions_len) {\n        al = SSL_AD_DECODE_ERROR;\n        SSLerr(SSL_F_TLS_EARLY_POST_PROCESS_CLIENT_HELLO, SSL_R_NO_COMPRESSION_SPECIFIED);\n        goto err;\n    }\n#ifndef OPENSSL_NO_EC\n    if (s->options & SSL_OP_SAFARI_ECDHE_ECDSA_BUG)\n        ssl_check_for_safari(s, clienthello);\n#endif\n    if (!tls_parse_all_extensions(s, SSL_EXT_CLIENT_HELLO,\n                                  clienthello->pre_proc_exts, NULL, 0, &al, 1)) {\n        SSLerr(SSL_F_TLS_EARLY_POST_PROCESS_CLIENT_HELLO, SSL_R_PARSE_TLSEXT);\n        goto err;\n    }\n    {\n        unsigned char *pos;\n        pos = s->s3->server_random;\n        if (ssl_fill_hello_random(s, 1, pos, SSL3_RANDOM_SIZE, dgrd) <= 0) {\n            goto err;\n        }\n    }\n    if (!s->hit\n            && s->version >= TLS1_VERSION\n            && !SSL_IS_TLS13(s)\n            && !SSL_IS_DTLS(s)\n            && s->ext.session_secret_cb) {\n        const SSL_CIPHER *pref_cipher = NULL;\n        int master_key_length;\n        master_key_length = sizeof(s->session->master_key);\n        if (s->ext.session_secret_cb(s, s->session->master_key,\n                                     &master_key_length, ciphers,\n                                     &pref_cipher,\n                                     s->ext.session_secret_cb_arg)\n                && master_key_length > 0) {\n            s->session->master_key_length = master_key_length;\n            s->hit = 1;\n            s->session->ciphers = ciphers;\n            s->session->verify_result = X509_V_OK;\n            ciphers = NULL;\n            if (pref_cipher == NULL)\n                pref_cipher = ssl3_choose_cipher(s, s->session->ciphers,\n                                                 SSL_get_ciphers(s));\n            if (pref_cipher == NULL) {\n                al = SSL_AD_HANDSHAKE_FAILURE;\n                SSLerr(SSL_F_TLS_EARLY_POST_PROCESS_CLIENT_HELLO, SSL_R_NO_SHARED_CIPHER);\n                goto 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    if (SSL_IS_TLS13(s)) {\n        if (clienthello->compressions_len != 1) {\n            al = SSL_AD_ILLEGAL_PARAMETER;\n            SSLerr(SSL_F_TLS_EARLY_POST_PROCESS_CLIENT_HELLO,\n                   SSL_R_INVALID_COMPRESSION_ALGORITHM);\n            goto err;\n        }\n    }\n#ifndef OPENSSL_NO_COMP\n    else 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_EARLY_POST_PROCESS_CLIENT_HELLO,\n                   SSL_R_INCONSISTENT_COMPRESSION);\n            goto 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_EARLY_POST_PROCESS_CLIENT_HELLO,\n                   SSL_R_INVALID_COMPRESSION_ALGORITHM);\n            goto err;\n        }\n        for (k = 0; k < clienthello->compressions_len; k++) {\n            if (clienthello->compressions[k] == comp_id)\n                break;\n        }\n        if (k >= clienthello->compressions_len) {\n            al = SSL_AD_ILLEGAL_PARAMETER;\n            SSLerr(SSL_F_TLS_EARLY_POST_PROCESS_CLIENT_HELLO,\n                   SSL_R_REQUIRED_COMPRESSION_ALGORITHM_MISSING);\n            goto 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 < clienthello->compressions_len; o++) {\n                if (v == clienthello->compressions[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_EARLY_POST_PROCESS_CLIENT_HELLO, SSL_R_INCONSISTENT_COMPRESSION);\n        goto err;\n    }\n#endif\n    if (!s->hit || SSL_IS_TLS13(s)) {\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_EARLY_POST_PROCESS_CLIENT_HELLO, ERR_R_INTERNAL_ERROR);\n            goto err;\n        }\n        ciphers = NULL;\n    }\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        if (!tls1_set_server_sigalgs(s)) {\n            SSLerr(SSL_F_TLS_EARLY_POST_PROCESS_CLIENT_HELLO, SSL_R_CLIENTHELLO_TLSEXT);\n            goto err;\n        }\n    }\n    sk_SSL_CIPHER_free(ciphers);\n    sk_SSL_CIPHER_free(scsvs);\n    OPENSSL_free(clienthello->pre_proc_exts);\n    OPENSSL_free(s->clienthello);\n    s->clienthello = NULL;\n    return 1;\n err:\n    ossl_statem_set_error(s);\n    *pal = al;\n    sk_SSL_CIPHER_free(ciphers);\n    sk_SSL_CIPHER_free(scsvs);\n    OPENSSL_free(clienthello->pre_proc_exts);\n    OPENSSL_free(s->clienthello);\n    s->clienthello = NULL;\n    return 0;\n}', 'int ssl_cache_cipherlist(SSL *s, PACKET *cipher_suites, int sslv2format,\n                         int *al)\n{\n    int n;\n    n = sslv2format ? SSLV2_CIPHER_LEN : TLS_CIPHER_LEN;\n    if (PACKET_remaining(cipher_suites) == 0) {\n        SSLerr(SSL_F_SSL_CACHE_CIPHERLIST, SSL_R_NO_CIPHERS_SPECIFIED);\n        *al = SSL_AD_ILLEGAL_PARAMETER;\n        return 0;\n    }\n    if (PACKET_remaining(cipher_suites) % n != 0) {\n        SSLerr(SSL_F_SSL_CACHE_CIPHERLIST,\n               SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST);\n        *al = SSL_AD_DECODE_ERROR;\n        return 0;\n    }\n    OPENSSL_free(s->s3->tmp.ciphers_raw);\n    s->s3->tmp.ciphers_raw = NULL;\n    s->s3->tmp.ciphers_rawlen = 0;\n    if (sslv2format) {\n        size_t numciphers = PACKET_remaining(cipher_suites) / n;\n        PACKET sslv2ciphers = *cipher_suites;\n        unsigned int leadbyte;\n        unsigned char *raw;\n        raw = OPENSSL_malloc(numciphers * TLS_CIPHER_LEN);\n        s->s3->tmp.ciphers_raw = raw;\n        if (raw == NULL) {\n            *al = SSL_AD_INTERNAL_ERROR;\n            goto err;\n        }\n        for (s->s3->tmp.ciphers_rawlen = 0;\n             PACKET_remaining(&sslv2ciphers) > 0;\n             raw += TLS_CIPHER_LEN) {\n            if (!PACKET_get_1(&sslv2ciphers, &leadbyte)\n                    || (leadbyte == 0\n                        && !PACKET_copy_bytes(&sslv2ciphers, raw,\n                                              TLS_CIPHER_LEN))\n                    || (leadbyte != 0\n                        && !PACKET_forward(&sslv2ciphers, TLS_CIPHER_LEN))) {\n                *al = SSL_AD_DECODE_ERROR;\n                OPENSSL_free(s->s3->tmp.ciphers_raw);\n                s->s3->tmp.ciphers_raw = NULL;\n                s->s3->tmp.ciphers_rawlen = 0;\n                goto err;\n            }\n            if (leadbyte == 0)\n                s->s3->tmp.ciphers_rawlen += TLS_CIPHER_LEN;\n        }\n    } else if (!PACKET_memdup(cipher_suites, &s->s3->tmp.ciphers_raw,\n                           &s->s3->tmp.ciphers_rawlen)) {\n        *al = SSL_AD_INTERNAL_ERROR;\n        goto err;\n    }\n    return 1;\n err:\n    return 0;\n}', "int bytes_to_cipher_list(SSL *s, PACKET *cipher_suites,\n                         STACK_OF(SSL_CIPHER) **skp,\n                         STACK_OF(SSL_CIPHER) **scsvs_out,\n                         int sslv2format, int *al)\n{\n    const SSL_CIPHER *c;\n    STACK_OF(SSL_CIPHER) *sk = NULL;\n    STACK_OF(SSL_CIPHER) *scsvs = NULL;\n    int n;\n    unsigned char cipher[SSLV2_CIPHER_LEN];\n    n = sslv2format ? SSLV2_CIPHER_LEN : TLS_CIPHER_LEN;\n    if (PACKET_remaining(cipher_suites) == 0) {\n        SSLerr(SSL_F_BYTES_TO_CIPHER_LIST, SSL_R_NO_CIPHERS_SPECIFIED);\n        *al = SSL_AD_ILLEGAL_PARAMETER;\n        return 0;\n    }\n    if (PACKET_remaining(cipher_suites) % n != 0) {\n        SSLerr(SSL_F_BYTES_TO_CIPHER_LIST,\n               SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST);\n        *al = SSL_AD_DECODE_ERROR;\n        return 0;\n    }\n    sk = sk_SSL_CIPHER_new_null();\n    scsvs = sk_SSL_CIPHER_new_null();\n    if (sk == NULL || scsvs == NULL) {\n        SSLerr(SSL_F_BYTES_TO_CIPHER_LIST, ERR_R_MALLOC_FAILURE);\n        *al = SSL_AD_INTERNAL_ERROR;\n        goto err;\n    }\n    while (PACKET_copy_bytes(cipher_suites, cipher, n)) {\n        if (sslv2format && cipher[0] != '\\0')\n            continue;\n        c = ssl_get_cipher_by_char(s, sslv2format ? &cipher[1] : cipher, 1);\n        if (c != NULL) {\n            if ((c->valid && !sk_SSL_CIPHER_push(sk, c)) ||\n                (!c->valid && !sk_SSL_CIPHER_push(scsvs, c))) {\n                SSLerr(SSL_F_BYTES_TO_CIPHER_LIST, ERR_R_MALLOC_FAILURE);\n                *al = SSL_AD_INTERNAL_ERROR;\n                goto err;\n            }\n        }\n    }\n    if (PACKET_remaining(cipher_suites) > 0) {\n        *al = SSL_AD_DECODE_ERROR;\n        SSLerr(SSL_F_BYTES_TO_CIPHER_LIST, SSL_R_BAD_LENGTH);\n        goto err;\n    }\n    if (skp != NULL)\n        *skp = sk;\n    else\n        sk_SSL_CIPHER_free(sk);\n    if (scsvs_out != NULL)\n        *scsvs_out = scsvs;\n    else\n        sk_SSL_CIPHER_free(scsvs);\n    return 1;\n err:\n    sk_SSL_CIPHER_free(sk);\n    sk_SSL_CIPHER_free(scsvs);\n    return 0;\n}", 'static ossl_inline int PACKET_copy_bytes(PACKET *pkt,\n                                                unsigned char *data, size_t len)\n{\n    if (!PACKET_peek_copy_bytes(pkt, data, len))\n        return 0;\n    packet_forward(pkt, len);\n    return 1;\n}', 'static ossl_inline void packet_forward(PACKET *pkt, size_t len)\n{\n    pkt->curr += len;\n    pkt->remaining -= len;\n}']