diff options
-rw-r--r-- | src/libutil/str_util.c | 7 |
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++; |