Closed
Bug 132862
Opened 23 years ago
Closed 21 years ago
wrong mem check after allocation in nsMsgDBView.cpp
Categories
(MailNews Core :: Database, defect)
Tracking
(Not tracked)
VERIFIED
FIXED
People
(Reporter: ftang, Assigned: bugzilla)
Details
Attachments
(1 file)
649 bytes,
patch
|
Details | Diff | Splinter Review |
I found some wrong null pointer check after allocation in nsMsgDBView.cpp
this could lead to crash when we are in memory pressure
I.
1665 *indices = (nsMsgViewIndex *)nsMemory::Alloc(numIndicies *
sizeof(nsMsgViewIndex));
1666 if (!indices) return NS_ERROR_OUT_OF_MEMORY;
line 1666 should be
1666 if (!(*indices)) return NS_ERROR_OUT_OF_MEMORY;
since the allocate return to *indicies instead of indicies
II.
there are no checking of null in
4922 PRInt32 *startRangeArray = (PRInt32*) PR_MALLOC(selectionCount*
sizeof(PRInt32));
4923 PRInt32 *endRangeArray = (PRInt32*) PR_MALLOC(selectionCount*
sizeof(PRInt32));
you should add
NS_ASSERTION(startRangeArray, "cannot allocate startRangeArray");
NS_ASSERTION(endRangeArray, "cannot allocate startRangeArray");
and also handle the case if either of them are null
cvsblame show the first one is mscott and the 2nd one is naving, assign to
mscott and cc naving
Updated•23 years ago
|
QA Contact: gayatri → stephend
Assignee | ||
Comment 1•21 years ago
|
||
I think II changed but issue I is still valid. will provide patch
Assignee | ||
Comment 2•21 years ago
|
||
I haven't tested the patch but it should work
Assignee | ||
Updated•21 years ago
|
Attachment #132732 -
Flags: review?(bienvenu)
Comment 3•21 years ago
|
||
Comment on attachment 132732 [details] [diff] [review]
patch to fix issue
r=bienvenu, thx
Attachment #132732 -
Flags: review?(bienvenu) → review+
Assignee | ||
Comment 4•21 years ago
|
||
Comment on attachment 132732 [details] [diff] [review]
patch to fix issue
If sr= is given could someone please checkin since I dont have CVS access
Attachment #132732 -
Flags: superreview?(sspitzer)
Assignee | ||
Updated•21 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Comment 6•21 years ago
|
||
Comment on attachment 132732 [details] [diff] [review]
patch to fix issue
please also do the checkin if sr=
Attachment #132732 -
Flags: superreview?(sspitzer) → superreview?(scott)
Assignee | ||
Comment 7•21 years ago
|
||
Comment on attachment 132732 [details] [diff] [review]
patch to fix issue
I'm told that you can also do sr= if the patch is small? Please also check in
Attachment #132732 -
Flags: superreview?(scott) → superreview?(bienvenu)
Comment 8•21 years ago
|
||
I've taken care of it, thx.
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Comment 9•21 years ago
|
||
Verified fixed using LXR as code inspection (as well as my local source tree).
Status: RESOLVED → VERIFIED
Assignee | ||
Updated•21 years ago
|
Attachment #132732 -
Flags: superreview?(bienvenu)
Attachment #132732 -
Flags: review+
Updated•20 years ago
|
Product: MailNews → Core
Updated•17 years ago
|
Product: Core → MailNews Core
You need to log in
before you can comment on or make changes to this bug.
Description
•