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


crypto/evp/e_aria.c:482:5: Call
480.           return 0;
481.       }
482.       CRYPTO_gcm128_tag(&gctx->gcm, EVP_CIPHER_CTX_buf_noconst(ctx), 16);
           ^
483.       gctx->taglen = 16;
484.       /* Don't reuse the IV */

crypto/modes/gcm128.c:1872:12: <Offset trace>
1870.       CRYPTO_gcm128_finish(ctx, NULL, 0);
1871.       memcpy(tag, ctx->Xi.c,
1872.              len <= sizeof(ctx->Xi.c) ? len : sizeof(ctx->Xi.c));
                   ^
1873.   }
1874.   

crypto/modes/gcm128.c:1872:12: Assignment
  1870.       CRYPTO_gcm128_finish(ctx, NULL, 0);
  1871.       memcpy(tag, ctx->Xi.c,
  1872.              len <= sizeof(ctx->Xi.c) ? len : sizeof(ctx->Xi.c));
                     ^
  1873.   }
  1874.   

crypto/modes/gcm128.c:1870:5: <Length trace>
1868.   void CRYPTO_gcm128_tag(GCM128_CONTEXT *ctx, unsigned char *tag, size_t len)
1869.   {
1870.       CRYPTO_gcm128_finish(ctx, NULL, 0);
            ^
1871.       memcpy(tag, ctx->Xi.c,
1872.              len <= sizeof(ctx->Xi.c) ? len : sizeof(ctx->Xi.c));

crypto/modes/gcm128.c:1870:5: Call
  1868.   void CRYPTO_gcm128_tag(GCM128_CONTEXT *ctx, unsigned char *tag, size_t len)
  1869.   {
  1870.       CRYPTO_gcm128_finish(ctx, NULL, 0);
              ^
  1871.       memcpy(tag, ctx->Xi.c,
  1872.              len <= sizeof(ctx->Xi.c) ? len : sizeof(ctx->Xi.c));

crypto/modes/gcm128.c:1794:1: Parameter `ctx->Xi.c[*]`
    1792.   }
    1793.   
    1794. > int CRYPTO_gcm128_finish(GCM128_CONTEXT *ctx, const unsigned char *tag,
    1795.                            size_t len)
    1796.   {

crypto/modes/gcm128.c:1871:5: Array access: Offset added: 16 Size: [0, +oo] by call to `CRYPTO_gcm128_tag` 
  1869.   {
  1870.       CRYPTO_gcm128_finish(ctx, NULL, 0);
  1871.       memcpy(tag, ctx->Xi.c,
              ^
  1872.              len <= sizeof(ctx->Xi.c) ? len : sizeof(ctx->Xi.c));
  1873.   }

void CRYPTO_gcm128_tag(GCM128_CONTEXT *ctx, unsigned char *tag, size_t len)
{
    CRYPTO_gcm128_finish(ctx, NULL, 0);
    memcpy(tag, ctx->Xi.c,
           len <= sizeof(ctx->Xi.c) ? len : sizeof(ctx->Xi.c));
}
['static int aria_gcm_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,\n                          const unsigned char *in, size_t len)\n{\n    EVP_ARIA_GCM_CTX *gctx = EVP_C_DATA(EVP_ARIA_GCM_CTX,ctx);\n    if (!gctx->key_set)\n        return -1;\n    if (gctx->tls_aad_len >= 0)\n        return aria_gcm_tls_cipher(ctx, out, in, len);\n    if (!gctx->iv_set)\n        return -1;\n    if (in) {\n        if (out == NULL) {\n            if (CRYPTO_gcm128_aad(&gctx->gcm, in, len))\n                return -1;\n        } else if (EVP_CIPHER_CTX_encrypting(ctx)) {\n            if (CRYPTO_gcm128_encrypt(&gctx->gcm, in, out, len))\n                return -1;\n        } else {\n            if (CRYPTO_gcm128_decrypt(&gctx->gcm, in, out, len))\n                return -1;\n        }\n        return len;\n    }\n    if (!EVP_CIPHER_CTX_encrypting(ctx)) {\n        if (gctx->taglen < 0)\n            return -1;\n        if (CRYPTO_gcm128_finish(&gctx->gcm,\n                                 EVP_CIPHER_CTX_buf_noconst(ctx),\n                                 gctx->taglen) != 0)\n            return -1;\n        gctx->iv_set = 0;\n        return 0;\n    }\n    CRYPTO_gcm128_tag(&gctx->gcm, EVP_CIPHER_CTX_buf_noconst(ctx), 16);\n    gctx->taglen = 16;\n    gctx->iv_set = 0;\n    return 0;\n}', 'void CRYPTO_gcm128_tag(GCM128_CONTEXT *ctx, unsigned char *tag, size_t len)\n{\n    CRYPTO_gcm128_finish(ctx, NULL, 0);\n    memcpy(tag, ctx->Xi.c,\n           len <= sizeof(ctx->Xi.c) ? len : sizeof(ctx->Xi.c));\n}', 'int CRYPTO_gcm128_finish(GCM128_CONTEXT *ctx, const unsigned char *tag,\n                         size_t len)\n{\n    const union {\n        long one;\n        char little;\n    } is_endian = { 1 };\n    u64 alen = ctx->len.u[0] << 3;\n    u64 clen = ctx->len.u[1] << 3;\n#ifdef GCM_FUNCREF_4BIT\n    void (*gcm_gmult_p) (u64 Xi[2], const u128 Htable[16]) = ctx->gmult;\n# if defined(GHASH) && !defined(OPENSSL_SMALL_FOOTPRINT)\n    void (*gcm_ghash_p) (u64 Xi[2], const u128 Htable[16],\n                         const u8 *inp, size_t len) = ctx->ghash;\n# endif\n#endif\n#if defined(GHASH) && !defined(OPENSSL_SMALL_FOOTPRINT)\n    u128 bitlen;\n    unsigned int mres = ctx->mres;\n    if (mres) {\n        unsigned blocks = (mres + 15) & -16;\n        memset(ctx->Xn + mres, 0, blocks - mres);\n        mres = blocks;\n        if (mres == sizeof(ctx->Xn)) {\n            GHASH(ctx, ctx->Xn, mres);\n            mres = 0;\n        }\n    } else if (ctx->ares) {\n        GCM_MUL(ctx);\n    }\n#else\n    if (ctx->mres || ctx->ares)\n        GCM_MUL(ctx);\n#endif\n    if (is_endian.little) {\n#ifdef BSWAP8\n        alen = BSWAP8(alen);\n        clen = BSWAP8(clen);\n#else\n        u8 *p = ctx->len.c;\n        ctx->len.u[0] = alen;\n        ctx->len.u[1] = clen;\n        alen = (u64)GETU32(p) << 32 | GETU32(p + 4);\n        clen = (u64)GETU32(p + 8) << 32 | GETU32(p + 12);\n#endif\n    }\n#if defined(GHASH) && !defined(OPENSSL_SMALL_FOOTPRINT)\n    bitlen.hi = alen;\n    bitlen.lo = clen;\n    memcpy(ctx->Xn + mres, &bitlen, sizeof(bitlen));\n    mres += sizeof(bitlen);\n    GHASH(ctx, ctx->Xn, mres);\n#else\n    ctx->Xi.u[0] ^= alen;\n    ctx->Xi.u[1] ^= clen;\n    GCM_MUL(ctx);\n#endif\n    ctx->Xi.u[0] ^= ctx->EK0.u[0];\n    ctx->Xi.u[1] ^= ctx->EK0.u[1];\n    if (tag && len <= sizeof(ctx->Xi))\n        return CRYPTO_memcmp(ctx->Xi.c, tag, len);\n    else\n        return -1;\n}']