From 0800288e6e1d9f44d471043a970ba57743ca8f4c Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Sat, 13 Jun 2020 22:16:14 +0200 Subject: [PATCH] EVP: allow empty strings to EVP_Decode* functions This is a simple check order correction. Fixes #12143 Reviewed-by: Ben Kaduk Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/12144) --- crypto/evp/encode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/evp/encode.c b/crypto/evp/encode.c index fb657d1499..01552ac098 100644 --- a/crypto/evp/encode.c +++ b/crypto/evp/encode.c @@ -423,7 +423,7 @@ static int evp_decodeblock_int(EVP_ENCODE_CTX *ctx, unsigned char *t, table = data_ascii2bin; /* trim white space from the start of the line. */ - while ((conv_ascii2bin(*f, table) == B64_WS) && (n > 0)) { + while ((n > 0) && (conv_ascii2bin(*f, table) == B64_WS)) { f++; n--; }