[tin-dev] [PATCH] quoted pairs in CFWS are not ignored

Dennis Preiser dennis at d--p.de
Sun Oct 8 18:32:25 CEST 2017


On Sun, Oct 08, 2017 at 06:14:28PM +0200, Dennis Preiser wrote:
> In src/rfc2046.c:remove_cwsp() we do not skip over those quoted pairs
> and thus the opening and closing brackets in the Content-Type:-header of
> the article remain unbalanced. The attached patch should fix this.

Attached to a revised version that skips quoted pairs only within a comment.

Dennis
-------------- next part --------------
diff -urp tin-2.4.2/src/rfc2046.c tin-2.4.2_r1/src/rfc2046.c
--- tin-2.4.2/src/rfc2046.c	2017-09-26 21:33:31.000000000 +0200
+++ tin-2.4.2_r1/src/rfc2046.c	2017-10-08 18:25:00.000000000 +0200
@@ -232,6 +232,11 @@ remove_cwsp(
 		}
 
 		if (!inquotes) {
+			/* skip over quoted pairs */
+			if (c_cnt && src == '\\') {
+				++from;
+				continue;
+			}
 			if (src == '(') {
 				++c_cnt;
 				continue;


More information about the tin-dev mailing list