Closed Bug 448165 Opened 18 years ago Closed 18 years ago

Mailnews crashes in [@ nsAbMDBDirectory::DeleteCards] if aCards is null

Categories

(MailNews Core :: Address Book, defect)

1.8 Branch
defect
Not set
critical

Tracking

(Not tracked)

VERIFIED FIXED
Thunderbird 3.0a3

People

(Reporter: pi, Assigned: pi)

Details

(Keywords: crash)

Crash Data

Attachments

(2 files)

nsAbMDBDirectory::DeleteCards doesn't check if aCards is null, so it is possible to crash Mailnews by passing null to the DeleteCards method of an MDB directory. It crashes on line 499 (trunk): http://mxr.mozilla.org/mailnews/source/mailnews/addrbook/src/nsAbMDBDirectory.cpp#499 Or line 476 for Thunderbird 2 http://mxr.mozilla.org/mozilla1.8.0/source/mailnews/addrbook/src/nsAbMDBDirectory.cpp#476 The attachment has a line of code that will crash Thunderbird 3 and another line for Thunderbird 2, if run in the Error Console. Patch and unit test coming soon.
This is a possible patch for the trunk with a unit test. I am not requesting review yet until I have a chance to try it in Windows. The patch just adds NS_ENSURE_ARG_POINTER(aCards); to the DeleteCards method.
I posted the wrong link under Thunderbird 2 in the first post (thanks sid0) It should be: http://mxr.mozilla.org/mozilla1.8/source/mailnews/addrbook/src/nsAbMDBDirectory.cpp#476 and the parameter is "cards" in Thunderbird 2.
Attachment #331459 - Attachment mime type: application/octet-stream → text/plain
Comment on attachment 331460 [details] [diff] [review] Patch with unit test I tested the patch and unit test in Windows.
Attachment #331460 - Flags: review?(bugzilla)
Severity: normal → critical
Summary: Mailnews crashes in nsAbMDBDirectory::DeleteCards if aCards is null → Mailnews crashes in [@ nsAbMDBDirectory::DeleteCards] if aCards is null
Attachment #331460 - Flags: superreview?(bienvenu)
Attachment #331460 - Flags: review?(bugzilla)
Attachment #331460 - Flags: review+
Attachment #331460 - Flags: superreview?(bienvenu) → superreview+
Product: Core → MailNews Core
Status: NEW → ASSIGNED
Flags: in-testsuite+
Keywords: checkin-needed
Why this was checked-in and never marked as fixed? Even no link to the changeset?
No longer depends on: 451306
(In reply to comment #4) > Why this was checked-in and never marked as fixed? Even no link to the > changeset? Opps, must have forgotten it. The changeset was 46:427e30ec8458, pushed on the 30th July.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Mark, any plans to get the patch into 1.8 branch? As I read the crash also happens on that branch.
Target Milestone: --- → Thunderbird 3.0b1
(In reply to comment #6) > Mark, any plans to get the patch into 1.8 branch? As I read the crash also > happens on that branch. If there's crashes in talkback that point directly to this, then yes I would consider it. However I think it unlikely as this is more likely to be picked up in extension dev. Therefore I think unless we have proof its needed, its not worth spending the time on.
Ok, so lets set the version to 1.8 to keep track. Verified so far with Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1b1pre) Gecko/20080903025653 Shredder/3.0b1pre Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1a2pre) Gecko/20080823031107 Shredder/3.0b1pre
Status: RESOLVED → VERIFIED
Version: Trunk → 1.8 Branch
Crash Signature: [@ nsAbMDBDirectory::DeleteCards]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: