Fix bug #3573: Out of bounds read in macro LBREAK_IF_REQUIRED
authorRicardo Mones <ricardo@mones.org>
Thu, 14 Jul 2016 09:52:43 +0000 (11:52 +0200)
committerRicardo Mones <ricardo@mones.org>
Thu, 14 Jul 2016 09:53:59 +0000 (11:53 +0200)
Thanks Hanno Boeck for the patch!

src/codeconv.c

index d0fbf70da2cd4d8622ef07ada35252fd62a2e1e4..11b23112c8b127fd15a653f9c8c04086ac8eec1c 100644 (file)
@@ -1584,9 +1584,7 @@ gchar *conv_unmime_header(const gchar *str, const gchar *default_encoding,
                                left = MAX_LINELEN - 1;                 \
                        }                                               \
                } else if (destp == (guchar *)dest && left < 7) {       \
-                       if (isspace(*(destp - 1)))                      \
-                               destp--;                                \
-                       else if (is_plain_text && isspace(*srcp))       \
+                       if (is_plain_text && isspace(*srcp))            \
                                srcp++;                                 \
                        if (*srcp) {                                    \
                                *destp++ = '\n';                        \