summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2020-06-13 22:16:14 +0200
committerPauli <paul.dale@oracle.com>2020-06-16 08:23:25 +1000
commit0800288e6e1d9f44d471043a970ba57743ca8f4c (patch)
tree50f3f8ea8c2f1aa53ed1a4c76642169f1e02549e /crypto
parent670ff08e77c5b331443a3ed6d41564d863a47f06 (diff)
EVP: allow empty strings to EVP_Decode* functions
This is a simple check order correction. Fixes #12143 Reviewed-by: Ben Kaduk <kaduk@mit.edu> Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/12144)
Diffstat (limited to 'crypto')
-rw-r--r--crypto/evp/encode.c2
1 files changed, 1 insertions, 1 deletions
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--;
}