Closed
Bug 91790
Opened 23 years ago
Closed 23 years ago
Malloc of 0 - nsMsgDBView.cpp
Categories
(MailNews Core :: Backend, defect)
MailNews Core
Backend
Tracking
(Not tracked)
VERIFIED
FIXED
People
(Reporter: mkaply, Assigned: mscott)
Details
Attachments
(1 file)
This code: http://lxr.mozilla.org/seamonkey/source/mailnews/base/src/nsMsgDBView. cpp#2206 Is bad. for empty folders, arraySize is 0, so not only does a malloc of 0 happen, but lots of unnecessary code is traversed. I am not sure what the right thing is to do here - possibly just return NS_OK if arraySize is 0?
Reporter | ||
Updated•23 years ago
|
OS: other → All
Hardware: Other → All
Reporter | ||
Comment 1•23 years ago
|
||
Reporter | ||
Comment 2•23 years ago
|
||
I've attached a fix for this. On OS/2 we were asserting all over the place on the 0 mallocs. This fixes all of our problems, and gives the same behavior as before. To test, go to an empty folder and try all the different sorts, as well as threaded view. everything should work as before.
Reporter | ||
Comment 3•23 years ago
|
||
Without this fix, mail is unstable on OS/2. The 0 mallocs causes us to get "Unknown error" popups and random crashes on release builds. I need this fix.
Severity: normal → critical
Assignee | ||
Comment 4•23 years ago
|
||
Mike, do you want me to check this patch in or do you want to? sr=mscott either way. although I prefer the if (!foo) notation insead of if (foo == 0). Either way though.
Reporter | ||
Comment 5•23 years ago
|
||
I'll check it in, no prob, and I'll fix the syntax. Do you definitely agree that this is the right thing to do (return NS_OK if there is nothing to sort)
Assignee | ||
Comment 6•23 years ago
|
||
yup, I agree that it's the right thing to do.
Reporter | ||
Comment 7•23 years ago
|
||
Fix checked in
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
QA Contact: esther → stephend
verified fixed via code inspection (using LXR).
Status: RESOLVED → VERIFIED
Updated•20 years ago
|
Product: MailNews → Core
Updated•16 years ago
|
Product: Core → MailNews Core
You need to log in
before you can comment on or make changes to this bug.
Description
•