ssl/record/ssl3_record.c:817: error: INTEGER_OVERFLOW_L2
  ([0, +oo] - [0, `*inrecs->data` + 1]):unsigned64 by call to `ssl3_cbc_remove_padding`.
Showing all 8 steps of the trace


ssl/record/ssl3_record.c:746:1: Parameter `*inrecs->data`
744.    *       occurred.
745.    */
746. > int ssl3_enc(SSL *s, SSL3_RECORD *inrecs, size_t n_recs, int sending)
747.   {
748.       SSL3_RECORD *rec;

ssl/record/ssl3_record.c:817:20: Call
815.           }
816.           if ((bs != 1) && !sending)
817.               return ssl3_cbc_remove_padding(rec, bs, mac_size);
                          ^
818.       }
819.       return (1);

ssl/record/ssl3_record.c:1275:1: <LHS trace>
1273.    *  -1: otherwise.
1274.    */
1275. > int ssl3_cbc_remove_padding(SSL3_RECORD *rec,
1276.                               size_t block_size, size_t mac_size)
1277.   {

ssl/record/ssl3_record.c:1275:1: Parameter `rec->length`
  1273.    *  -1: otherwise.
  1274.    */
  1275. > int ssl3_cbc_remove_padding(SSL3_RECORD *rec,
  1276.                               size_t block_size, size_t mac_size)
  1277.   {

ssl/record/ssl3_record.c:1275:1: <RHS trace>
1273.    *  -1: otherwise.
1274.    */
1275. > int ssl3_cbc_remove_padding(SSL3_RECORD *rec,
1276.                               size_t block_size, size_t mac_size)
1277.   {

ssl/record/ssl3_record.c:1275:1: Parameter `*rec->data`
  1273.    *  -1: otherwise.
  1274.    */
  1275. > int ssl3_cbc_remove_padding(SSL3_RECORD *rec,
  1276.                               size_t block_size, size_t mac_size)
  1277.   {

ssl/record/ssl3_record.c:1288:5: Assignment
  1286.           return 0;
  1287.   
  1288.       padding_length = rec->data[rec->length - 1];
              ^
  1289.       good = constant_time_ge_s(rec->length, padding_length + overhead);
  1290.       /* SSLv3 requires that the padding is minimal. */

ssl/record/ssl3_record.c:1292:5: Binary operation: ([0, +oo] - [0, *inrecs->data + 1]):unsigned64 by call to `ssl3_cbc_remove_padding` 
  1290.       /* SSLv3 requires that the padding is minimal. */
  1291.       good &= constant_time_ge_s(block_size, padding_length + 1);
  1292.       rec->length -= good & (padding_length + 1);
              ^
  1293.       return constant_time_select_int_s(good, 1, -1);
  1294.   }

int ssl3_cbc_remove_padding(SSL3_RECORD *rec,
                            size_t block_size, size_t mac_size)
{
    size_t padding_length;
    size_t good;
    const size_t overhead = 1    + mac_size;
    if (overhead > rec->length)
        return 0;
    padding_length = rec->data[rec->length - 1];
    good = constant_time_ge_s(rec->length, padding_length + overhead);
    good &= constant_time_ge_s(block_size, padding_length + 1);
    rec->length -= good & (padding_length + 1);
    return constant_time_select_int_s(good, 1, -1);
}
['int ssl3_enc(SSL *s, SSL3_RECORD *inrecs, size_t n_recs, int sending)\n{\n    SSL3_RECORD *rec;\n    EVP_CIPHER_CTX *ds;\n    size_t l, i;\n    size_t bs, mac_size = 0;\n    int imac_size;\n    const EVP_CIPHER *enc;\n    rec = inrecs;\n    if (n_recs != 1)\n        return 0;\n    if (sending) {\n        ds = s->enc_write_ctx;\n        if (s->enc_write_ctx == NULL)\n            enc = NULL;\n        else\n            enc = EVP_CIPHER_CTX_cipher(s->enc_write_ctx);\n    } else {\n        ds = s->enc_read_ctx;\n        if (s->enc_read_ctx == NULL)\n            enc = NULL;\n        else\n            enc = EVP_CIPHER_CTX_cipher(s->enc_read_ctx);\n    }\n    if ((s->session == NULL) || (ds == NULL) || (enc == NULL)) {\n        memmove(rec->data, rec->input, rec->length);\n        rec->input = rec->data;\n    } else {\n        l = rec->length;\n        bs = EVP_CIPHER_CTX_block_size(ds);\n        if ((bs != 1) && sending) {\n            i = bs - (l % bs);\n            l += i;\n            memset(&rec->input[rec->length], 0, i);\n            rec->length += i;\n            rec->input[l - 1] = (unsigned char)(i - 1);\n        }\n        if (!sending) {\n            if (l == 0 || l % bs != 0)\n                return 0;\n        }\n        if (EVP_Cipher(ds, rec->data, rec->input, (unsigned int)l) < 1)\n            return -1;\n        if (EVP_MD_CTX_md(s->read_hash) != NULL) {\n            imac_size = EVP_MD_CTX_size(s->read_hash);\n            if (imac_size < 0)\n                return -1;\n            mac_size = (size_t)imac_size;\n        }\n        if ((bs != 1) && !sending)\n            return ssl3_cbc_remove_padding(rec, bs, mac_size);\n    }\n    return (1);\n}', 'int ssl3_cbc_remove_padding(SSL3_RECORD *rec,\n                            size_t block_size, size_t mac_size)\n{\n    size_t padding_length;\n    size_t good;\n    const size_t overhead = 1    + mac_size;\n    if (overhead > rec->length)\n        return 0;\n    padding_length = rec->data[rec->length - 1];\n    good = constant_time_ge_s(rec->length, padding_length + overhead);\n    good &= constant_time_ge_s(block_size, padding_length + 1);\n    rec->length -= good & (padding_length + 1);\n    return constant_time_select_int_s(good, 1, -1);\n}']