]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Core: Fix length calculations
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 17 Dec 2018 17:25:13 +0000 (17:25 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 17 Dec 2018 17:25:13 +0000 (17:25 +0000)
src/libutil/str_util.c

index 949bdd3371d86a19fefe4e2e6403eaad76ab5d2e..0c63edba2d1d8be3277587b92b5cf03ca3c26037 100644 (file)
@@ -935,7 +935,7 @@ rspamd_encode_qp_fold (const guchar *in, gsize inlen, gint str_len,
                        span += 3;
                }
 
-               if (str_len > 0 && span >= str_len) {
+               if (str_len > 0 && span + 3 >= str_len) {
                        if (how == RSPAMD_TASK_NEWLINES_CRLF) {
                                /* =\r\n */
                                olen += 3;