Closed Bug 348762 Opened 14 years ago Closed 14 years ago

uploading message with mixed line endings in headers can corrupt headers

Categories

(MailNews Core :: Networking: IMAP, defect)

x86
Windows XP
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: Bienvenu, Assigned: Bienvenu)

Details

(Keywords: fixed1.8.1)

Attachments

(1 file)

If you upload a message to an imap folder that contains mixed line endings, you can end up with missing/corrupt headers on the imap server. The problem is that the code to find lines assumes the lines are all terminated the same way. Usually this will be true, but I've seen one case where this isn't true : when you have an rss message with a wrapped subject. All the headers lines are \n terminated, but the wrapped subject has a \r\n in it. We were looking for \r lines and if we didn't find any, we looked for \n lines. But this made us miss the headers up to the subject. Fix upcoming...
Attached patch proposed fixSplinter Review
use strpbrk to find the first /r or /n - this works a lot better in my test cases.
Attachment #233834 - Flags: superreview?(mscott)
Attachment #233834 - Flags: superreview?(mscott) → superreview+
Status: NEW → RESOLVED
Closed: 14 years ago
Keywords: fixed1.8.1
Resolution: --- → FIXED
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.