From edfbcb989d5776b678c9990936b0d52d1528023d Mon Sep 17 00:00:00 2001 From: Nevine Ebeid <66388554+nebeid@users.noreply.github.com> Date: Fri, 15 Mar 2024 14:10:28 -0400 Subject: [PATCH] Update return value from EVP_Encode_Update in one error case (#1499) Coverity pointed that total was not used in this `if` statement which returns right away. It was because of introducing the return statements in https://github.com/aws/aws-lc/commit/6d9a7675d1f7c2f159b76e4ade309220d54d96f4. The comments indicate that the intention is to update out_len as on line 180. --- crypto/base64/base64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/base64/base64.c b/crypto/base64/base64.c index b51c1ba83b..b3a3868412 100644 --- a/crypto/base64/base64.c +++ b/crypto/base64/base64.c @@ -193,7 +193,7 @@ int EVP_EncodeUpdate(EVP_ENCODE_CTX *ctx, uint8_t *out, int *out_len, if (total > INT_MAX) { // We cannot signal an error, but we can at least avoid making *out_len // negative. - total = 0; + *out_len = 0; return 0; } *out_len = (int)total;