[PATCH] quoted pairs in CFWS are not ignored
tin fails to display the following article properly: | Newsgroups: de.test | Subject: Re: Überlange Zeile mit "😂 " | Message-ID: <AABZ2kP/jGUAAA5p.A1s1.flnews@WStation7.micha.freeshell.org> | Content-Type: (Comment(\)))text/plain(Comment) ; | charset(Bla)=UTF-8 | (Unicode); | format=(\)Blubb)flowed; | delsp=yes | Content-Transfer-Encoding: 8bit According to RFC 5322, CFWS can contain quoted pairs: | FWS = ([*WSP CRLF] 1*WSP) / obs-FWS | ; Folding white space | | ctext = %d33-39 / ; Printable US-ASCII | %d42-91 / ; characters not including | %d93-126 / ; "(", ")", or "\" | obs-ctext | | ccontent = ctext / quoted-pair / comment | | comment = "(" *([FWS] ccontent) [FWS] ")" | | CFWS = (1*([FWS] comment) [FWS]) / FWS 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. Dennis
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
participants (1)
-
Dennis Preiser