From 2bd0d4c467001f72d50f45977a500cea4e5e3369 Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Mon, 28 Dec 2020 23:49:48 -0600 Subject: [PATCH] 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. --- wolfcrypt/src/evp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wolfcrypt/src/evp.c b/wolfcrypt/src/evp.c index 6ef7214ca..01844cc7e 100644 --- a/wolfcrypt/src/evp.c +++ b/wolfcrypt/src/evp.c @@ -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,