<<< Date Index >>>     <<< Thread Index >>>

Re: RFC 2047 encoder botched?



On 2007-05-31 18:30:37 +0100, Thomas Roessler wrote:

> When replying to the attached message, the subject header gets
> botched, and one of the RFC 2047 encoded-words torn apart.  I
> haven't time right now to track that down to a specific version.

A little bit of poking at the relevant code suggests that
write_one_header in sendlib.c doesn't treat cases correctly in which
an encoded word gets too long.  From staring at the code, I don't
see where that bug is.

A quick workaround is to shorten the maximum length of an
encoded-word in rfc2047.c, but that's not really satisfactory.

Any takers for fixing the underlying problem?

-- 
Thomas Roessler   <roessler@xxxxxxxxxxxxxxxxxx>




diff -r 9e90789518ad -r eb6be38fe84f rfc2047.c
--- a/rfc2047.c Tue Jun 05 13:12:05 2007 -0700
+++ b/rfc2047.c Fri Jun 08 12:36:50 2007 +0200
@@ -41,7 +41,7 @@
 #include <assert.h>
 #endif
 
-#define ENCWORD_LEN_MAX 75
+#define ENCWORD_LEN_MAX 62
 #define ENCWORD_LEN_MIN 9 /* strlen ("=?.?.?.?=") */
 
 #define HSPACE(x) ((x) == '\0' || (x) == ' ' || (x) == '\t')