Closed Bug 197203 Opened 21 years ago Closed 21 years ago

crash if no '@' in From field address

Categories

(MailNews Core :: Composition, defect)

All
Windows XP
defect
Not set
critical

Tracking

(Not tracked)

RESOLVED FIXED
mozilla1.4alpha

People

(Reporter: parish, Assigned: parish)

References

Details

(Keywords: crash, stackwanted)

Attachments

(1 file, 1 obsolete file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4a) Gecko/20030313 Netscape6/6.5
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4a) Gecko/20030313

If you use a munged anti-spam address without a '@' in it, Mozilla crashes shen
you click Send.

Reproducible: Always

Steps to Reproduce:
1. Edit your mail account e-mail address, or create a dummy account, and
replace/remove the '@', e.g. parish_AT_ntlworld.com

2. Compose a mail using the munged address for the From

3. Click Send or Send Later.


Actual Results:  
Mozilla crashes with an Access violation in msgcompo.dll

Note, this does not happen if you use such an address in the To:/Cc: fields.


Expected Results:  
Mail should be sent or saved in Unsent Messages.

Patch on it's way
In msg_generate_message_id(), PL_strchr() returns a null ptr if no '@' in From
address. We don't check for this before incrementing it and passing to
isValidHost() where it crashes.
Attachment #117085 - Flags: review?(ducarroz)
Marking NEW since it has a patch.
Severity: normal → critical
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: crash, stackwanted
reassign to ssu
Assignee: ducarroz → ssu
Comment on attachment 117085 [details] [diff] [review]
Check for PL_strchr() returning a null ptr.

R=ducarroz
Attachment #117085 - Flags: review?(ducarroz) → review+
Attachment #117085 - Flags: superreview?(sspitzer)
re-assign to parish@ntlworld.com, since he as a patch.

I'll review and drive this in today, since it is a crasher.
Assignee: ssu → parish
actually, the patch could just be:

if (host)
  ++host;

because right after that, we call if (!isValidHost(host)) and return if it 
isn't valid, and it will do the right thing if host is null.

I'll attach a modified patch.
Attached patch modified patchSplinter Review
also, use strchr(), instead of PL_strchr() for performance reasons.
Attachment #117085 - Attachment is obsolete: true
Attachment #117085 - Flags: superreview?(sspitzer) → superreview-
parish, thanks for logging the bug and finding the fix.

I'll land the modified patch today.

assigning to 1.4 alpha, and marking "accepted" on parish's behalf.
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla1.4alpha
I've checked in the patch based on parish's initial patch.
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Summary: Mozilla crashes if no '@' in From field address → crash if no '@' in From field address
*** Bug 198256 has been marked as a duplicate of this bug. ***
*** Bug 203375 has been marked as a duplicate of this bug. ***
*** Bug 205619 has been marked as a duplicate of this bug. ***
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: