foldLine blows up on long quoted-printable lines #6

dobesv opened this Issue Nov 15, 2011 · 4 comments


None yet

2 participants

dobesv commented Nov 15, 2011

For example:

console.log('folded...', require('mimelib-noiconv').foldLine('Subject: =?UTF-8?Q?lalalla_[Problem_Type:__=E7=84=A1=E6=AD=A4=E9=A0=85=E7=9B=AE_problem!]?='));

Will exhaust all memory and crash the process.

dobesv commented Nov 15, 2011

Here's another sample:

var problem = 'Subject: =?UTF-8?Q?lalalla_[Problem_Type:_=E7=84=A1=E6=AD=A4=E9=A0=85=E7=9B=AE=AE=AE=AE=AE=AE=AE=AE=AE?=';
var folded = require('mimelib-noiconv').foldLine(problem);

It's important to make sure that the fix doesn't eliminate part of the character code here.

dobesv commented Nov 15, 2011

I was going to prepare a patch but I'm not sure what the correct behavior would be. I posted a question to stack overflow:

andris9 commented Nov 17, 2011

I removed the patch that tried to fold long quoted printable lines. It aint according to the spec (lines cant be longer than 76 chars) but at least it works.

andris9 commented Sep 1, 2012

This issue is now fixed, quoted printable lines are no longer than 76 + 2 () bytes

@andris9 andris9 closed this Sep 1, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment