crypto/rand/drbg_ctr.c:238: error: INTEGER_OVERFLOW_L2
  (0 - [-oo, 32]):unsigned64 by call to `EVP_CipherUpdate`.
Showing all 9 steps of the trace


crypto/rand/drbg_ctr.c:238:10: Call
236.       /* correct key is already set up. */
237.       inc_128(ctr);
238.       if (!EVP_CipherUpdate(ctr->ctx, ctr->K, &outlen, ctr->V, AES_BLOCK_SIZE)
                ^
239.           || outlen != AES_BLOCK_SIZE)
240.           return 0;

crypto/evp/evp_enc.c:209:1: Parameter `ctx->cipher->block_size`
  207.   }
  208.   
  209. > int EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl,
  210.                        const unsigned char *in, int inl)
  211.   {

crypto/evp/evp_enc.c:215:16: Call
  213.           return EVP_EncryptUpdate(ctx, out, outl, in, inl);
  214.       else
  215.           return EVP_DecryptUpdate(ctx, out, outl, in, inl);
                        ^
  216.   }
  217.   

crypto/evp/evp_enc.c:423:1: Parameter `ctx->cipher->block_size`
    421.   }
    422.   
    423. > int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl,
    424.                         const unsigned char *in, int inl)
    425.   {

crypto/evp/evp_enc.c:429:5: Assignment
    427.       unsigned int b;
    428.   
    429.       b = ctx->cipher->block_size;
               ^
    430.   
    431.       if (EVP_CIPHER_CTX_test_flags(ctx, EVP_CIPH_FLAG_LENGTH_BITS))

crypto/evp/evp_enc.c:462:16: Call
    460.           /* see comment about PTRDIFF_T comparison above */
    461.           if (((PTRDIFF_T)out == (PTRDIFF_T)in)
    462.               || is_partially_overlapping(out, in, b)) {
                          ^
    463.               EVPerr(EVP_F_EVP_DECRYPTUPDATE, EVP_R_PARTIALLY_OVERLAPPING);
    464.               return 0;

crypto/evp/evp_enc.c:283:1: <RHS trace>
281.   #endif
282.   
283. > int is_partially_overlapping(const void *ptr1, const void *ptr2, int len)
284.   {
285.       PTRDIFF_T diff = (PTRDIFF_T)ptr1-(PTRDIFF_T)ptr2;

crypto/evp/evp_enc.c:283:1: Parameter `len`
      281.   #endif
      282.   
      283. > int is_partially_overlapping(const void *ptr1, const void *ptr2, int len)
      284.   {
      285.       PTRDIFF_T diff = (PTRDIFF_T)ptr1-(PTRDIFF_T)ptr2;

crypto/evp/evp_enc.c:292:50: Binary operation: (0 - [-oo, 32]):unsigned64 by call to `EVP_CipherUpdate` 
      290.        */
      291.       int overlapped = (len > 0) & (diff != 0) & ((diff < (PTRDIFF_T)len) |
      292.                                                   (diff > (0 - (PTRDIFF_T)len)));
                                                              ^
      293.   
      294.       return overlapped;

int is_partially_overlapping(const void *ptr1, const void *ptr2, int len)
{
    PTRDIFF_T diff = (PTRDIFF_T)ptr1-(PTRDIFF_T)ptr2;
    int overlapped = (len > 0) & (diff != 0) & ((diff < (PTRDIFF_T)len) |
                                                (diff > (0 - (PTRDIFF_T)len)));
    return overlapped;
}
['static int ctr_update(RAND_DRBG *drbg,\n                             const unsigned char *in1, size_t in1len,\n                             const unsigned char *in2, size_t in2len,\n                             const unsigned char *nonce, size_t noncelen)\n{\n    RAND_DRBG_CTR *ctr = &drbg->data.ctr;\n    int outlen = AES_BLOCK_SIZE;\n    inc_128(ctr);\n    if (!EVP_CipherUpdate(ctr->ctx, ctr->K, &outlen, ctr->V, AES_BLOCK_SIZE)\n        || outlen != AES_BLOCK_SIZE)\n        return 0;\n    if (ctr->keylen != 16) {\n        inc_128(ctr);\n        if (!EVP_CipherUpdate(ctr->ctx, ctr->K+16, &outlen, ctr->V,\n                              AES_BLOCK_SIZE)\n            || outlen != AES_BLOCK_SIZE)\n            return 0;\n    }\n    inc_128(ctr);\n    if (!EVP_CipherUpdate(ctr->ctx, ctr->V, &outlen, ctr->V, AES_BLOCK_SIZE)\n        || outlen != AES_BLOCK_SIZE)\n        return 0;\n    if (ctr->keylen == 24) {\n        memcpy(ctr->V + 8, ctr->V, 8);\n        memcpy(ctr->V, ctr->K + 24, 8);\n    }\n    if ((drbg->flags & RAND_DRBG_FLAG_CTR_NO_DF) == 0) {\n        if (in1 != NULL || nonce != NULL || in2 != NULL)\n            if (!ctr_df(ctr, in1, in1len, nonce, noncelen, in2, in2len))\n                return 0;\n        if (in1len)\n            ctr_XOR(ctr, ctr->KX, drbg->seedlen);\n    } else {\n        ctr_XOR(ctr, in1, in1len);\n        ctr_XOR(ctr, in2, in2len);\n    }\n    if (!EVP_CipherInit_ex(ctr->ctx, ctr->cipher, NULL, ctr->K, NULL, 1))\n        return 0;\n    return 1;\n}', 'int EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl,\n                     const unsigned char *in, int inl)\n{\n    if (ctx->encrypt)\n        return EVP_EncryptUpdate(ctx, out, outl, in, inl);\n    else\n        return EVP_DecryptUpdate(ctx, out, outl, in, inl);\n}', 'int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl,\n                      const unsigned char *in, int inl)\n{\n    int fix_len, cmpl = inl;\n    unsigned int b;\n    b = ctx->cipher->block_size;\n    if (EVP_CIPHER_CTX_test_flags(ctx, EVP_CIPH_FLAG_LENGTH_BITS))\n        cmpl = (cmpl + 7) / 8;\n    if (ctx->cipher->flags & EVP_CIPH_FLAG_CUSTOM_CIPHER) {\n        if (b == 1 && is_partially_overlapping(out, in, cmpl)) {\n            EVPerr(EVP_F_EVP_DECRYPTUPDATE, EVP_R_PARTIALLY_OVERLAPPING);\n            return 0;\n        }\n        fix_len = ctx->cipher->do_cipher(ctx, out, in, inl);\n        if (fix_len < 0) {\n            *outl = 0;\n            return 0;\n        } else\n            *outl = fix_len;\n        return 1;\n    }\n    if (inl <= 0) {\n        *outl = 0;\n        return inl == 0;\n    }\n    if (ctx->flags & EVP_CIPH_NO_PADDING)\n        return EVP_EncryptUpdate(ctx, out, outl, in, inl);\n    OPENSSL_assert(b <= sizeof(ctx->final));\n    if (ctx->final_used) {\n        if (((PTRDIFF_T)out == (PTRDIFF_T)in)\n            || is_partially_overlapping(out, in, b)) {\n            EVPerr(EVP_F_EVP_DECRYPTUPDATE, EVP_R_PARTIALLY_OVERLAPPING);\n            return 0;\n        }\n        memcpy(out, ctx->final, b);\n        out += b;\n        fix_len = 1;\n    } else\n        fix_len = 0;\n    if (!EVP_EncryptUpdate(ctx, out, outl, in, inl))\n        return 0;\n    if (b > 1 && !ctx->buf_len) {\n        *outl -= b;\n        ctx->final_used = 1;\n        memcpy(ctx->final, &out[*outl], b);\n    } else\n        ctx->final_used = 0;\n    if (fix_len)\n        *outl += b;\n    return 1;\n}', 'int is_partially_overlapping(const void *ptr1, const void *ptr2, int len)\n{\n    PTRDIFF_T diff = (PTRDIFF_T)ptr1-(PTRDIFF_T)ptr2;\n    int overlapped = (len > 0) & (diff != 0) & ((diff < (PTRDIFF_T)len) |\n                                                (diff > (0 - (PTRDIFF_T)len)));\n    return overlapped;\n}']