]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Fix] Fix out-of-bound access in base64 decode
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 16 Mar 2017 18:38:13 +0000 (18:38 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 16 Mar 2017 18:38:13 +0000 (18:38 +0000)
src/libcryptobox/base64/ref.c
src/libcryptobox/base64/sse42.c

index 2d757fe23a0b05463b4978d3557976d15595e17d..797a91ce7bb9acef4fb4c869c5761e87ef9cf299 100644 (file)
@@ -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 --;
                }
index 12c6e3413a3cf7d912733fa6ea2b716981bcfb8a..db585a637a80209c32571d4a3532b8fa766549cf 100644 (file)
@@ -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 --;
                }