crypto/rand/drbg_ctr.c:196: error: INTEGER_OVERFLOW_L2
  ([1, `in1len`] - 8):unsigned64 by call to `ctr_BCC_update`.
Showing all 7 steps of the trace


crypto/rand/drbg_ctr.c:165:8: Parameter `in1len`
163.   }
164.   
165.   __owur static int ctr_df(RAND_DRBG_CTR *ctr,
              ^
166.                            const unsigned char *in1, size_t in1len,
167.                            const unsigned char *in2, size_t in2len,

crypto/rand/drbg_ctr.c:196:10: Call
194.       *p = (unsigned char)((ctr->keylen + 16) & 0xff);
195.       ctr->bltmp_pos = 8;
196.       if (!ctr_BCC_update(ctr, in1, in1len)
                ^
197.           || !ctr_BCC_update(ctr, in2, in2len)
198.           || !ctr_BCC_update(ctr, in3, in3len)

crypto/rand/drbg_ctr.c:120:8: <LHS trace>
118.    * Process several blocks into BCC algorithm, some possibly partial
119.    */
120.   __owur static int ctr_BCC_update(RAND_DRBG_CTR *ctr,
              ^
121.                                    const unsigned char *in, size_t inlen)
122.   {

crypto/rand/drbg_ctr.c:120:8: Parameter `inlen`
  118.    * Process several blocks into BCC algorithm, some possibly partial
  119.    */
  120.   __owur static int ctr_BCC_update(RAND_DRBG_CTR *ctr,
                ^
  121.                                    const unsigned char *in, size_t inlen)
  122.   {

crypto/rand/drbg_ctr.c:120:8: <RHS trace>
118.    * Process several blocks into BCC algorithm, some possibly partial
119.    */
120.   __owur static int ctr_BCC_update(RAND_DRBG_CTR *ctr,
              ^
121.                                    const unsigned char *in, size_t inlen)
122.   {

crypto/rand/drbg_ctr.c:120:8: Parameter `inlen`
  118.    * Process several blocks into BCC algorithm, some possibly partial
  119.    */
  120.   __owur static int ctr_BCC_update(RAND_DRBG_CTR *ctr,
                ^
  121.                                    const unsigned char *in, size_t inlen)
  122.   {

crypto/rand/drbg_ctr.c:136:13: Binary operation: ([1, in1len] - 8):unsigned64 by call to `ctr_BCC_update` 
  134.                   return 0;
  135.               ctr->bltmp_pos = 0;
  136.               inlen -= left;
                     ^
  137.               in += left;
  138.           }

static int ctr_BCC_update(RAND_DRBG_CTR *ctr,
                                 const unsigned char *in, size_t inlen)
{
    if (in == NULL || inlen == 0)
        return 1;
    if (ctr->bltmp_pos) {
        size_t left = 16 - ctr->bltmp_pos;
        if (inlen >= left) {
            memcpy(ctr->bltmp + ctr->bltmp_pos, in, left);
            if (!ctr_BCC_blocks(ctr, ctr->bltmp))
                return 0;
            ctr->bltmp_pos = 0;
            inlen -= left;
            in += left;
        }
    }
    for (; inlen >= 16; in += 16, inlen -= 16) {
        if (!ctr_BCC_blocks(ctr, in))
            return 0;
    }
    if (inlen > 0) {
        memcpy(ctr->bltmp + ctr->bltmp_pos, in, inlen);
        ctr->bltmp_pos += inlen;
    }
    return 1;
}
['static int ctr_df(RAND_DRBG_CTR *ctr,\n                         const unsigned char *in1, size_t in1len,\n                         const unsigned char *in2, size_t in2len,\n                         const unsigned char *in3, size_t in3len)\n{\n    static unsigned char c80 = 0x80;\n    size_t inlen;\n    unsigned char *p = ctr->bltmp;\n    int outlen = AES_BLOCK_SIZE;\n    if (!ctr_BCC_init(ctr))\n        return 0;\n    if (in1 == NULL)\n        in1len = 0;\n    if (in2 == NULL)\n        in2len = 0;\n    if (in3 == NULL)\n        in3len = 0;\n    inlen = in1len + in2len + in3len;\n    *p++ = (inlen >> 24) & 0xff;\n    *p++ = (inlen >> 16) & 0xff;\n    *p++ = (inlen >> 8) & 0xff;\n    *p++ = inlen & 0xff;\n    *p++ = 0;\n    *p++ = 0;\n    *p++ = 0;\n    *p = (unsigned char)((ctr->keylen + 16) & 0xff);\n    ctr->bltmp_pos = 8;\n    if (!ctr_BCC_update(ctr, in1, in1len)\n        || !ctr_BCC_update(ctr, in2, in2len)\n        || !ctr_BCC_update(ctr, in3, in3len)\n        || !ctr_BCC_update(ctr, &c80, 1)\n        || !ctr_BCC_final(ctr))\n        return 0;\n    if (!EVP_CipherInit_ex(ctr->ctx, ctr->cipher, NULL, ctr->KX, NULL, 1))\n        return 0;\n    if (!EVP_CipherUpdate(ctr->ctx, ctr->KX, &outlen, ctr->KX + ctr->keylen,\n                          AES_BLOCK_SIZE)\n        || outlen != AES_BLOCK_SIZE)\n        return 0;\n    if (!EVP_CipherUpdate(ctr->ctx, ctr->KX + 16, &outlen, ctr->KX,\n                          AES_BLOCK_SIZE)\n        || outlen != AES_BLOCK_SIZE)\n        return 0;\n    if (ctr->keylen != 16)\n        if (!EVP_CipherUpdate(ctr->ctx, ctr->KX + 32, &outlen, ctr->KX + 16,\n                              AES_BLOCK_SIZE)\n            || outlen != AES_BLOCK_SIZE)\n            return 0;\n    return 1;\n}', 'static int ctr_BCC_update(RAND_DRBG_CTR *ctr,\n                                 const unsigned char *in, size_t inlen)\n{\n    if (in == NULL || inlen == 0)\n        return 1;\n    if (ctr->bltmp_pos) {\n        size_t left = 16 - ctr->bltmp_pos;\n        if (inlen >= left) {\n            memcpy(ctr->bltmp + ctr->bltmp_pos, in, left);\n            if (!ctr_BCC_blocks(ctr, ctr->bltmp))\n                return 0;\n            ctr->bltmp_pos = 0;\n            inlen -= left;\n            in += left;\n        }\n    }\n    for (; inlen >= 16; in += 16, inlen -= 16) {\n        if (!ctr_BCC_blocks(ctr, in))\n            return 0;\n    }\n    if (inlen > 0) {\n        memcpy(ctr->bltmp + ctr->bltmp_pos, in, inlen);\n        ctr->bltmp_pos += inlen;\n    }\n    return 1;\n}']