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


crypto/evp/e_aes.c:927:3: Call
925.   		out += len;
926.   		/* Finally write tag */
927.   		CRYPTO_gcm128_tag(&gctx->gcm, out, EVP_GCM_TLS_TAG_LEN);
         ^
928.   		rv = len + EVP_GCM_TLS_EXPLICIT_IV_LEN + EVP_GCM_TLS_TAG_LEN;
929.   		}

crypto/modes/gcm128.c:1431:25: <Offset trace>
1429.   {
1430.   	CRYPTO_gcm128_finish(ctx, NULL, 0);
1431.   	memcpy(tag, ctx->Xi.c, len<=sizeof(ctx->Xi.c)?len:sizeof(ctx->Xi.c));
                                ^
1432.   }
1433.   

crypto/modes/gcm128.c:1431:25: Assignment
  1429.   {
  1430.   	CRYPTO_gcm128_finish(ctx, NULL, 0);
  1431.   	memcpy(tag, ctx->Xi.c, len<=sizeof(ctx->Xi.c)?len:sizeof(ctx->Xi.c));
                                  ^
  1432.   }
  1433.   

crypto/modes/gcm128.c:1428:1: <Length trace>
1426.   }
1427.   
1428. > void CRYPTO_gcm128_tag(GCM128_CONTEXT *ctx, unsigned char *tag, size_t len)
1429.   {
1430.   	CRYPTO_gcm128_finish(ctx, NULL, 0);

crypto/modes/gcm128.c:1428:1: Parameter `ctx->Xi.c[*]`
  1426.   }
  1427.   
  1428. > void CRYPTO_gcm128_tag(GCM128_CONTEXT *ctx, unsigned char *tag, size_t len)
  1429.   {
  1430.   	CRYPTO_gcm128_finish(ctx, NULL, 0);

crypto/modes/gcm128.c:1431:2: Array access: Offset added: 16 Size: [0, +oo] by call to `CRYPTO_gcm128_tag` 
  1429.   {
  1430.   	CRYPTO_gcm128_finish(ctx, NULL, 0);
  1431.   	memcpy(tag, ctx->Xi.c, len<=sizeof(ctx->Xi.c)?len:sizeof(ctx->Xi.c));
           ^
  1432.   }
  1433.   

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 aes_gcm_tls_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,\n\t\tconst unsigned char *in, size_t len)\n\t{\n\tEVP_AES_GCM_CTX *gctx = ctx->cipher_data;\n\tint rv = -1;\n\tif (out != in)\n\t\treturn -1;\n\tif (EVP_CIPHER_CTX_ctrl(ctx, ctx->encrypt ?\n\t\t\t\tEVP_CTRL_GCM_IV_GEN : EVP_CTRL_GCM_SET_IV_INV,\n\t\t\t\tEVP_GCM_TLS_EXPLICIT_IV_LEN, out) <= 0)\n\t\tgoto err;\n\tif (CRYPTO_gcm128_aad(&gctx->gcm, ctx->buf, gctx->tls_aad_len))\n\t\tgoto err;\n\tin += EVP_GCM_TLS_EXPLICIT_IV_LEN;\n\tout += EVP_GCM_TLS_EXPLICIT_IV_LEN;\n\tlen -= EVP_GCM_TLS_EXPLICIT_IV_LEN + EVP_GCM_TLS_TAG_LEN;\n\tif (ctx->encrypt)\n\t\t{\n\t\tif (CRYPTO_gcm128_encrypt(&gctx->gcm, in, out, len))\n\t\t\tgoto err;\n\t\tout += len;\n\t\tCRYPTO_gcm128_tag(&gctx->gcm, out, EVP_GCM_TLS_TAG_LEN);\n\t\trv = len + EVP_GCM_TLS_EXPLICIT_IV_LEN + EVP_GCM_TLS_TAG_LEN;\n\t\t}\n\telse\n\t\t{\n\t\tif (CRYPTO_gcm128_decrypt(&gctx->gcm, in, out, len))\n\t\t\tgoto err;\n\t\tCRYPTO_gcm128_tag(&gctx->gcm, ctx->buf,\n\t\t\t\t\tEVP_GCM_TLS_TAG_LEN);\n\t\tif (memcmp(ctx->buf, in + len, EVP_GCM_TLS_TAG_LEN))\n\t\t\t{\n\t\t\tOPENSSL_cleanse(out, len);\n\t\t\tgoto err;\n\t\t\t}\n\t\trv = len;\n\t\t}\n\terr:\n\tgctx->iv_set = 0;\n\tgctx->tls_aad_len = -1;\n\treturn rv;\n\t}', 'void CRYPTO_gcm128_tag(GCM128_CONTEXT *ctx, unsigned char *tag, size_t len)\n{\n\tCRYPTO_gcm128_finish(ctx, NULL, 0);\n\tmemcpy(tag, ctx->Xi.c, len<=sizeof(ctx->Xi.c)?len:sizeof(ctx->Xi.c));\n}']