aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil/str_util.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-08-27 15:46:47 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-08-27 16:54:45 +0100
commitb8e311739520ed266a02bc02bccd3fbcdf4dc131 (patch)
treeec725df21efb0d411e900013e0be3088c76242dc /src/libutil/str_util.c
parent964621fef554d1fc03af0bb63e4a441605bb060d (diff)
downloadrspamd-b8e311739520ed266a02bc02bccd3fbcdf4dc131.tar.gz
rspamd-b8e311739520ed266a02bc02bccd3fbcdf4dc131.zip
[Fix] Fix read-after-end in quoted printable decoding
Diffstat (limited to 'src/libutil/str_util.c')
-rw-r--r--src/libutil/str_util.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/libutil/str_util.c b/src/libutil/str_util.c
index 89d94992b..91199aec1 100644
--- a/src/libutil/str_util.c
+++ b/src/libutil/str_util.c
@@ -2081,15 +2081,18 @@ rspamd_decode_qp_buf (const gchar *in, gsize inlen,
while (remain > 0 && o < end) {
if (*p == '=') {
- p ++;
remain --;
if (remain == 0) {
+ /* Last '=' character, bugon */
if (end - o > 0) {
*o++ = *p;
- break;
}
+
+ break;
}
+
+ p ++;
decode:
/* Decode character after '=' */
c = *p++;