Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prettym added some WS inside content-type parameters #76

Closed
lyrm opened this issue Jul 27, 2021 · 2 comments
Closed

Prettym added some WS inside content-type parameters #76

lyrm opened this issue Jul 27, 2021 · 2 comments

Comments

@lyrm
Copy link
Contributor

lyrm commented Jul 27, 2021

Hi,
Last issue that I identified with the fuzzed mail generator: it seems that prettym sometimes adds white spaces at the beginning or at the end of content-type parameters inside the quotes. That make the comparison functions of Content_type.Parameter not work properly.

If it is an expected behavior, we should add trim in the comparison functions.

Some seeds with this issue: 157, 160, 164, 221, 272, 319, 322.

@dinosaure
Copy link
Member

From the seed 157, we can explain what happens. The Content-Type has such value

Content-Type: video/vnd.CCTV; ^M
                3ww$-+sp{6w32pil%`xa'}0gzr'g*="a-9I\\b?X>y+O>hkHm^S3MgL^Cw^Q}^XL9O^M
               "; `l#vtr*.losaoqw!mcsnsj#z~="^E'Z/M)^_^]8nWf(D^Y(k^O"; ^M
                cgjhm.="k^XR^Oy^A^EgZeKR*{^]4&Rn-8N5^e^^"; ^M
                or_6ccs#3="/0\vKmSWL9V^D:.^E<Thg"^M

The end of the quoted-string is done by (l. 3):

               "

So all spaces are added into the quoted-string. The quoted-string value contains, so, spaces. prettym then try to indent the Content-Type and adds, as you said, spaces:

Content-Type: video/vnd.CCTV; ^M$
                3ww$-+sp{6w32pil%`xa'}0gzr'g*="a-9I\b?X>y+O>hkHm^S3MgL^Cw^Q}^XL9O               ^M$
               "; `l#vtr*.losaoqw!mcsnsj#z~="^E'Z/M)^_^]8nWf(D^Y(k^O"; ^M$

I will try to propose a patch to limit this behavior and don't let to prettym the opportunity to split/insert fws at this step.

@dinosaure
Copy link
Member

Fixed by #77

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants