Closed Bug 185959 Opened 22 years ago Closed 22 years ago

Many function(For exam. Reply, Forward) works and leads to crash before user login

Categories

(MailNews Core :: Composition, defect)

defect
Not set
critical

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: antonio.xu, Assigned: antonio.xu)

References

Details

(Keywords: crash)

Attachments

(2 files, 2 obsolete files)

The function of Reply, Forward to a message should not work before user enter
password and login. But They are working in Mozilla 1.2 and leads to crash.

Steps to reproduce for Reply:
1. Start an IMAP account and select its any folder to try to login, cancel the
password dialog.
2. Select a message in a folder('INBOX' or another), cancel the password dialog.
3. You can see the Reply, Reply All, Forward button freshed and can work now.
4. Select Reply button.
5. The reply window will jump out with the 'To:' editbox null. Press at the
'To:' to try to add an address.
6. Crash.

Actual Results: crash 
Expected Results:  no crash
Keywords: crash
*** Bug 186096 has been marked as a duplicate of this bug. ***
Attached patch patch version 1.0 (obsolete) — Splinter Review
I have reserched this bug, I found when we replay a email, mailnews will try to
load the email's body from Imap server, but if we do it before login imap
server. mozilla will crash due to due to mailnews didn't set
m_imapMiscellaneousSink in imapurl. So when mailnews login unsuccessfully,
mailnews will use m_imapMiscellaneousSink to fire some event, but
m_imapMiscellaneousSinke is null pointer. I think the best way to fix this
problem is add a judgement  to aviod use null pointer, furthermore we should
popup a the login dialog to prompt user inputing the password, so I set
m_imapServerSink in imapurl. So mailnews will popup a dialog before mailnew get
email's body for quote.
Attached patch patch version 1.1 (obsolete) — Splinter Review
please review
Attachment #109719 - Attachment is obsolete: true
Attachment #109737 - Flags: review?(Henry.Jia)
Comment on attachment 109737 [details] [diff] [review]
patch version 1.1

Anto, thx for the patch. But it needs to be improved.

1. You use 'mailnewsUrl->SetFolder(folder);' before 'if (mailnewsUrl)'. It's
also a issue in previous code.

2. 'mailnewsUrl->SetFolder(folder);' is executed in SetImapUrlSink, so no need
to do it again. Also, no need to do 'if (mailnewsUrl)'.

Also, why 'NS_ENSURE_SUCCESS(rv, rv);'?
Attachment #109737 - Flags: review?(Henry.Jia) → review-
I did check in the biff crash part of the fix (the check for the null
m_imapMiscellaneousSink) along with some other changes because I was trying to
reproduce this crash.
change some code according to Henry's advice
Attachment #109737 - Attachment is obsolete: true
Comment on attachment 109970 [details] [diff] [review]
patch version 1.2

Hi Henry,Could you review my new patch?
Thank you.
Attachment #109970 - Flags: review?(Henry.Jia)
Comment on attachment 109970 [details] [diff] [review]
patch version 1.2

Thx for the patch.

r=henry
Attachment #109970 - Flags: review?(Henry.Jia) → review+
Attachment #109970 - Flags: superreview?(bienvenu)
Comment on attachment 109970 [details] [diff] [review]
patch version 1.2

Hi Bienvenu, Could you super review my patch?
Thank you.
antonio, can I get a -uw diff so I can see what you've really changed and not
just the whitespace changes? thx.
This patch was maked by "cvs -uw".
Attachment #110921 - Flags: superreview?(bienvenu)
Attachment #110921 - Flags: review+
Comment on attachment 110921 [details] [diff] [review]
patch for super review

sr=bienvenu, thx. I'm a little worried about removing the null checks for
folder and mailnewsurl but I guess they'll never be null...
Attachment #110921 - Flags: superreview?(bienvenu) → superreview+
Yes. The pointer is not null when code goes here.
fix checked in trunk
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Attachment #109970 - Flags: superreview?(bienvenu)
Product: MailNews → Core
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: