crypto/evp/e_aes.c:1993: error: BUFFER_OVERRUN_L3
  Offset added: [2, 16] Size: [0, +oo] by call to `CRYPTO_ccm128_tag`.
Showing all 7 steps of the trace


crypto/evp/e_aes.c:1948:1: Parameter `ctx->cipher_data->M`
1946.   }
1947.   
1948. > static int aes_ccm_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
1949.                             const unsigned char *in, size_t len)
1950.   {

crypto/evp/e_aes.c:1993:17: Call
1991.               !CRYPTO_ccm128_decrypt(ccm, in, out, len)) {
1992.               unsigned char tag[16];
1993.               if (CRYPTO_ccm128_tag(ccm, tag, cctx->M)) {
                        ^
1994.                   if (!CRYPTO_memcmp(tag, ctx->buf, cctx->M))
1995.                       rv = len;

crypto/modes/ccm128.c:469:1: <Offset trace>
467.   }
468.   
469. > size_t CRYPTO_ccm128_tag(CCM128_CONTEXT *ctx, unsigned char *tag, size_t len)
470.   {
471.       unsigned int M = (ctx->nonce.c[0] >> 3) & 7; /* the M parameter */

crypto/modes/ccm128.c:469:1: Parameter `len`
  467.   }
  468.   
  469. > size_t CRYPTO_ccm128_tag(CCM128_CONTEXT *ctx, unsigned char *tag, size_t len)
  470.   {
  471.       unsigned int M = (ctx->nonce.c[0] >> 3) & 7; /* the M parameter */

crypto/modes/ccm128.c:469:1: <Length trace>
467.   }
468.   
469. > size_t CRYPTO_ccm128_tag(CCM128_CONTEXT *ctx, unsigned char *tag, size_t len)
470.   {
471.       unsigned int M = (ctx->nonce.c[0] >> 3) & 7; /* the M parameter */

crypto/modes/ccm128.c:469:1: Parameter `ctx->cmac.c[*]`
  467.   }
  468.   
  469. > size_t CRYPTO_ccm128_tag(CCM128_CONTEXT *ctx, unsigned char *tag, size_t len)
  470.   {
  471.       unsigned int M = (ctx->nonce.c[0] >> 3) & 7; /* the M parameter */

crypto/modes/ccm128.c:477:5: Array access: Offset added: [2, 16] Size: [0, +oo] by call to `CRYPTO_ccm128_tag` 
  475.       if (len < M)
  476.           return 0;
  477.       memcpy(tag, ctx->cmac.c, M);
             ^
  478.       return M;
  479.   }

size_t CRYPTO_ccm128_tag(CCM128_CONTEXT *ctx, unsigned char *tag, size_t len)
{
    unsigned int M = (ctx->nonce.c[0] >> 3) & 7;
    M *= 2;
    M += 2;
    if (len < M)
        return 0;
    memcpy(tag, ctx->cmac.c, M);
    return M;
}
['static int aes_ccm_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,\n                          const unsigned char *in, size_t len)\n{\n    EVP_AES_CCM_CTX *cctx = ctx->cipher_data;\n    CCM128_CONTEXT *ccm = &cctx->ccm;\n    if (!cctx->iv_set && !cctx->key_set)\n        return -1;\n    if (!ctx->encrypt && !cctx->tag_set)\n        return -1;\n    if (!out) {\n        if (!in) {\n            if (CRYPTO_ccm128_setiv(ccm, ctx->iv, 15 - cctx->L, len))\n                return -1;\n            cctx->len_set = 1;\n            return len;\n        }\n        if (!cctx->len_set && len)\n            return -1;\n        CRYPTO_ccm128_aad(ccm, in, len);\n        return len;\n    }\n    if (!in)\n        return 0;\n    if (!cctx->len_set) {\n        if (CRYPTO_ccm128_setiv(ccm, ctx->iv, 15 - cctx->L, len))\n            return -1;\n        cctx->len_set = 1;\n    }\n    if (ctx->encrypt) {\n        if (cctx->str ? CRYPTO_ccm128_encrypt_ccm64(ccm, in, out, len,\n                                                    cctx->str) :\n            CRYPTO_ccm128_encrypt(ccm, in, out, len))\n            return -1;\n        cctx->tag_set = 1;\n        return len;\n    } else {\n        int rv = -1;\n        if (cctx->str ? !CRYPTO_ccm128_decrypt_ccm64(ccm, in, out, len,\n                                                     cctx->str) :\n            !CRYPTO_ccm128_decrypt(ccm, in, out, len)) {\n            unsigned char tag[16];\n            if (CRYPTO_ccm128_tag(ccm, tag, cctx->M)) {\n                if (!CRYPTO_memcmp(tag, ctx->buf, cctx->M))\n                    rv = len;\n            }\n        }\n        if (rv == -1)\n            OPENSSL_cleanse(out, len);\n        cctx->iv_set = 0;\n        cctx->tag_set = 0;\n        cctx->len_set = 0;\n        return rv;\n    }\n}', 'size_t CRYPTO_ccm128_tag(CCM128_CONTEXT *ctx, unsigned char *tag, size_t len)\n{\n    unsigned int M = (ctx->nonce.c[0] >> 3) & 7;\n    M *= 2;\n    M += 2;\n    if (len < M)\n        return 0;\n    memcpy(tag, ctx->cmac.c, M);\n    return M;\n}']