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?
Created attachment 43169 [details] [diff] [review] Three View cases - return if there are no items to sort
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.
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
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.
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)
yup, I agree that it's the right thing to do.
Fix checked in
Status: NEW → RESOLVED
Last Resolved: 18 years ago
Resolution: --- → FIXED
QA Contact: esther → stephend
verified fixed via code inspection (using LXR).
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.