summaryrefslogtreecommitdiffstats
path: root/src/libcryptobox
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-03-16 18:38:13 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2017-03-16 18:38:13 +0000
commit81addbcb2e86f9f97866bec1b2a16a78dd91ec87 (patch)
tree2bdb77c953bc531cb0571074490a579d5caad785 /src/libcryptobox
parent9206ce91df6c796baf09b63963de7da668c25a63 (diff)
downloadrspamd-81addbcb2e86f9f97866bec1b2a16a78dd91ec87.tar.gz
rspamd-81addbcb2e86f9f97866bec1b2a16a78dd91ec87.zip
[Fix] Fix out-of-bound access in base64 decode
Diffstat (limited to 'src/libcryptobox')
-rw-r--r--src/libcryptobox/base64/ref.c2
-rw-r--r--src/libcryptobox/base64/sse42.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/libcryptobox/base64/ref.c b/src/libcryptobox/base64/ref.c
index 2d757fe23..797a91ce7 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 12c6e3413..db585a637 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 --;
}