From: Vsevolod Stakhov Date: Thu, 16 Mar 2017 18:38:13 +0000 (+0000) Subject: [Fix] Fix out-of-bound access in base64 decode X-Git-Tag: 1.5.3~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=81addbcb2e86f9f97866bec1b2a16a78dd91ec87;p=thirdparty%2Frspamd.git [Fix] Fix out-of-bound access in base64 decode --- diff --git a/src/libcryptobox/base64/ref.c b/src/libcryptobox/base64/ref.c index 2d757fe23a..797a91ce7b 100644 --- a/src/libcryptobox/base64/ref.c +++ b/src/libcryptobox/base64/ref.c @@ -215,7 +215,7 @@ repeat: if (!ret && inlen > 0) { /* Skip to the next valid character in input */ - while (base64_table_dec[*c] >= 254 && inlen > 0) { + while (inlen > 0 && base64_table_dec[*c] >= 254) { c ++; inlen --; } diff --git a/src/libcryptobox/base64/sse42.c b/src/libcryptobox/base64/sse42.c index 12c6e3413a..db585a637a 100644 --- a/src/libcryptobox/base64/sse42.c +++ b/src/libcryptobox/base64/sse42.c @@ -244,7 +244,7 @@ repeat: if (!ret && inlen > 0) { /* Skip to the next valid character in input */ - while (base64_table_dec[*c] >= 254 && inlen > 0) { + while (inlen > 0 && base64_table_dec[*c] >= 254) { c ++; inlen --; }