Closed
Bug 211276
Opened 22 years ago
Closed 22 years ago
nsStaticCaseInsensitiveNameTable::Init doesn't check the return value of PL_DHashTableInit
Categories
(Core :: XPCOM, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: timeless, Assigned: timeless)
References
()
Details
Attachments
(1 file, 1 obsolete file)
(deleted),
patch
|
alecf
:
review+
dbaron
:
superreview+
|
Details | Diff | Splinter Review |
This is a code inspection bug.
QA:
To verify that this bug is fixed, make sure that all callers in of
PL_DHashTableInit in the indicated class/file check and handle a failure return
result.
To verify that this bug is invalid, simply verify (e.g. with lxr) that
PL_DHashTableInit is no longer used by the indicated class/file.
PL_DHashTableInit returns a PRBool indicating whether it succeeded.
PL_DHashTableInit *can* fail. Code can not assume that table->ops or table-
>data will be null (in fact it probably will not be), although in all
likelyhood table->entryStore will be null it probably isn't safe to assume this.
Code at time of bug filing:
131 mNameArray = (nsDependentCString*)nsMemory::Alloc(Count * sizeof
(nsDependentCString));
132 PL_DHashTableInit(&mNameTable, &nametable_CaseInsensitiveHashTableOps,
133 nsnull, sizeof(nameTableEntry), Count);
134 if (!mNameArray || !mNameTable.ops) {
135 return PR_FALSE;
136 }
Status: NEW → ASSIGNED
Attachment #126835 -
Flags: superreview?(dbaron)
Attachment #126835 -
Flags: review?(alecf)
Comment 2•22 years ago
|
||
Comment on attachment 126835 [details] [diff] [review]
proposed patch
If you're going to bother writing the code to handle out-of-memory here, you
should fix the destructor as well.
Attachment #126835 -
Flags: superreview?(dbaron) → superreview-
Attachment #126835 -
Flags: review?(alecf)
Attachment #126835 -
Attachment is obsolete: true
Attachment #127031 -
Flags: superreview?(dbaron)
Updated•22 years ago
|
Attachment #127031 -
Flags: superreview?(dbaron)
Attachment #127031 -
Flags: superreview+
Attachment #127031 -
Flags: review?(alecf)
Comment 4•22 years ago
|
||
Comment on attachment 127031 [details] [diff] [review]
-uwp11, 4 space indentation, fixes destructor
r=alecf
Attachment #127031 -
Flags: review?(alecf) → review+
checked in
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•