User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:184.108.40.206) Gecko/20061215 Firefox/220.127.116.11 Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:18.104.22.168) Gecko/20061215 Firefox/22.214.171.124 Seamonkey 1.0.6 (used on Gentoo Linux). On retrieving or displaying a message with a long invalid "Date:" get an assertion in mozilla/nsprpub/pr/src/misc/prtime.c with : Assertion failure: 0, at ../../../../mozilla/nsprpub/pr/src/misc/prtime.c:992 Only occurs when DEBUG is set (I think), but this seems to be a useful option to help catch problems. debug is apparently enabled by default in the source package on mozilla.org debug is disabled on the binary package - the message displays as completely empty. Reproducible: Always Steps to Reproduce: 1. Open a bad message (attachment) 2. 3. Actual Results: Assertion. Only workaround is to delete the message(s) from all mail folders, and also from the mailserver Expected Results: No assertion with bad messages. Possibly to display the faulty date information as part of the message?
debug is definitely not enabled on mozilla.org source packages. but anyway, this bug was fixed on gecko 1.8.1 and later. *** This bug has been marked as a duplicate of 247896 ***
Status: UNCONFIRMED → RESOLVED
Last Resolved: 11 years ago
Resolution: --- → DUPLICATE
Attachment #249097 - Attachment mime type: message/rfc822 → text/plain
Attachment #249097 - Attachment mime type: text/plain → message/rfc822
Comment on attachment 249097 [details] Test .eml - causes debug assertion in prtime.c Charlie, Your test .eml contains three dates: Mon, 18 Dec 2006 19:32:19 +0100 Mon, 18 Dec 2006 19:32:42 +0100 Mon, 18 Dec 2006 19:32:01 +0100 None of them looks like a long invalid date.
hm sorry, this isn't actually a duplicate. it's a different assertion. wtc: the lines following the date: header start with a space. that means that they are a continuation of the date header. Presumably mailnews passes basically the entire rest of the file to PR_ParseTimeString.
Status: RESOLVED → UNCONFIRMED
Resolution: DUPLICATE → ---
I assumed that debug was enabled in the Seamonkey source, because I couldn't find anything appearing to enable it in any of the Gentoo applied patches. Apologies - I should have done a build from the clean source... I think that *if* it is valid for a date header to extend over many lines, then there should not be the arbitrary limit on the number of parsing operations. There could be further valid headers and a real message after the multi-line date, which are currently lost. (BTW - I meant to point out that this is not a dup of #247896 ... I made the same mistake at first. sorry again!)
Created attachment 250719 [details] [diff] [review] Patch rev. 1 This fixes the crash by changing the assert to a warning. I've also enabled the 1000 iterations check in non-debug builds since I see no reason to iterate more than that. I also took the liberty to fix a typo that makes us fail to parse "AST" as a timezone. http://bonsai.mozilla.org/cvsblame.cgi?file=/mozilla/nsprpub/pr/src/misc/prtime.c&rev=3.26&root=/cvsroot&mark=1007#999
Attachment #250719 - Flags: review?(wtchang)
Assignee: mail → wtchang
Component: MailNews: Main Mail Window → NSPR
Product: Mozilla Application Suite → NSPR
QA Contact: nspr
Version: unspecified → other
Summary: Seamonkey: PR_ParseTimeString use PR_Assert and it calls abort on invalid date → PR_ParseTimeString use PR_Assert and it calls abort on invalid date
Wan-Teh, can you review this in near future or should I ask someone else?
Attachment #250719 - Flags: review?(wtchang) → review?(darin.moz)
Attachment #250719 - Flags: review?(darin.moz) → review?(wtc)
Created attachment 275712 [details] Test program with a very long input The long input date/time string 'str' in this test program triggers the assertion failure.
Created attachment 275714 [details] Test program with a very long input I added a new input string ('str3') that is 266 character long. PR_ParseTimeString returns PR_SUCCESS with this string. This means PR_ParseTimeString tolerates junk after a valid string. With this patch, it will tolerate only some amount of junk after a valid string, but will reject a string if the junk exceeds some limit.
Attachment #275712 - Attachment is obsolete: true
Created attachment 275716 [details] [diff] [review] Mats Palmgren's patch (as checked in) I checked in Mats Palmgren's patch on the NSPR trunk (NSPR 4.7), without the PR_LOG statement. Checking in prtime.c; /cvsroot/mozilla/nsprpub/pr/src/misc/prtime.c,v <-- prtime.c new revision: 3.30; previous revision: 3.29 done
Status: NEW → RESOLVED
Last Resolved: 11 years ago → 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → 4.7
You need to log in before you can comment on or make changes to this bug.