foldLine blows up on long quoted-printable lines #6

Closed
dobesv opened this Issue Nov 15, 2011 · 4 comments

Projects

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);
console.log(problem);
console.log(folded);

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:

http://stackoverflow.com/questions/8132599/how-should-quoted-printable-mime-words-be-wrapped-to-the-correct-line-length

Owner
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.

Owner
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