summaryrefslogtreecommitdiff
path: root/libmailutils
diff options
context:
space:
mode:
Diffstat (limited to 'libmailutils')
-rw-r--r--libmailutils/filter/qpflt.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/libmailutils/filter/qpflt.c b/libmailutils/filter/qpflt.c
index 08f6d3046..b1a177b37 100644
--- a/libmailutils/filter/qpflt.c
+++ b/libmailutils/filter/qpflt.c
@@ -84,7 +84,7 @@ _qp_decoder (void *xd,
sz = osize - nbytes;
else
sz = wscount;
- memcpy(optr, iptr - wscount - 1, sz);
+ memcpy (optr, iptr - wscount - 1, sz);
optr += sz;
nbytes += sz;
if (wscount > sz)
@@ -100,9 +100,22 @@ _qp_decoder (void *xd,
if (c == '=')
{
- /* There must be 2 more characters before I consume this. */
- if (consumed + 2 >= isize)
+ if (consumed + 1 == isize)
break;
+
+ if (*iptr == '\n')
+ {
+ iptr++;
+ consumed++;
+ }
+ else if (consumed + 2 >= isize)
+ /* There must be 2 more characters before I consume this. */
+ break;
+ else if (iptr[0] == '\r' && iptr[1] == '\n')
+ {
+ iptr += 2;
+ consumed += 2;
+ }
else
{
/* you get =XX where XX are hex characters. */

Return to:

Send suggestions and report system problems to the System administrator.