wolfcrypt/src/evp.c: fix wolfSSL_EVP_CipherUpdate_GCM() to not fail when inl is zero, to properly handle realloc implementations that return NULL for zero-size allocations.

This commit is contained in:
Daniel Pouzzner 2020-12-28 23:49:48 -06:00
parent fbcfc6adbf
commit 2bd0d4c467

View File

@ -580,7 +580,7 @@ static int wolfSSL_EVP_CipherUpdate_GCM(WOLFSSL_EVP_CIPHER_CTX *ctx,
*outl = inl;
if (out) {
/* Buffer input for one-shot API */
if (ret == 0) {
if (inl > 0) {
byte* tmp;
tmp = (byte*)XREALLOC(ctx->gcmBuffer,
ctx->gcmBufferLen + inl, NULL,