crypto/evp/e_aes.c:3757: 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:3727:1: Parameter `len`
3725.   }
3726.   
3727. > static int aes_ccm_tls_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
3728.                                 const unsigned char *in, size_t len)
3729.   {

crypto/evp/e_aes.c:3757:14: Call
3755.               CRYPTO_ccm128_encrypt(ccm, in, out, len))
3756.               return -1;
3757.           if (!CRYPTO_ccm128_tag(ccm, out + len, cctx->M))
                     ^
3758.               return -1;
3759.           return len + EVP_CCM_TLS_EXPLICIT_IV_LEN + cctx->M;

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

crypto/modes/ccm128.c:422:1: Parameter `len`
  420.   }
  421.   
  422. > size_t CRYPTO_ccm128_tag(CCM128_CONTEXT *ctx, unsigned char *tag, size_t len)
  423.   {
  424.       unsigned int M = (ctx->nonce.c[0] >> 3) & 7; /* the M parameter */

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

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

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

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_tls_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,\n                              const unsigned char *in, size_t len)\n{\n    EVP_AES_CCM_CTX *cctx = EVP_C_DATA(EVP_AES_CCM_CTX,ctx);\n    CCM128_CONTEXT *ccm = &cctx->ccm;\n    if (out != in || len < (EVP_CCM_TLS_EXPLICIT_IV_LEN + (size_t)cctx->M))\n        return -1;\n    if (EVP_CIPHER_CTX_encrypting(ctx))\n        memcpy(out, EVP_CIPHER_CTX_buf_noconst(ctx),\n               EVP_CCM_TLS_EXPLICIT_IV_LEN);\n    memcpy(EVP_CIPHER_CTX_iv_noconst(ctx) + EVP_CCM_TLS_FIXED_IV_LEN, in,\n           EVP_CCM_TLS_EXPLICIT_IV_LEN);\n    len -= EVP_CCM_TLS_EXPLICIT_IV_LEN + cctx->M;\n    if (CRYPTO_ccm128_setiv(ccm, EVP_CIPHER_CTX_iv_noconst(ctx), 15 - cctx->L,\n                            len))\n            return -1;\n    CRYPTO_ccm128_aad(ccm, EVP_CIPHER_CTX_buf_noconst(ctx), cctx->tls_aad_len);\n    in += EVP_CCM_TLS_EXPLICIT_IV_LEN;\n    out += EVP_CCM_TLS_EXPLICIT_IV_LEN;\n    if (EVP_CIPHER_CTX_encrypting(ctx)) {\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        if (!CRYPTO_ccm128_tag(ccm, out + len, cctx->M))\n            return -1;\n        return len + EVP_CCM_TLS_EXPLICIT_IV_LEN + cctx->M;\n    } else {\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, in + len, cctx->M))\n                    return len;\n            }\n        }\n        OPENSSL_cleanse(out, len);\n        return -1;\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}']