Closed Bug 211273 Opened 23 years ago Closed 19 years ago

nsWindow::nsWindow doesn't check the return value of PL_DHashTableInit

Categories

(Core :: Widget: Gtk, defect)

x86
Windows 2000
defect
Not set
minor

Tracking

()

VERIFIED WONTFIX

People

(Reporter: timeless, Unassigned)

References

()

Details

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: 280 if (gXICLookupTable.ops == NULL) { 281 PL_DHashTableInit(&gXICLookupTable, PL_DHashGetStubOps(), nsnull, 282 sizeof(nsXICLookupEntry), PL_DHASH_MIN_SIZE); 283 } 284 #endif // USE_XIM A simple change would be to null gXICLookupTable.ops, but nsWindow really needs to be refactored so that allocations that can fail are done in a function which can return a failure result.
Component: RDF → GFX: Gtk
QA Contact: pavlov
Assignee: pkw → nobody
PL_NewDHashTable should also be checked because that function uses PL_DHashTableInit too. 330 sIconCache = PL_NewDHashTable(&iconHashOps, nsnull, sizeof(IconEntry), 28);
GTK1 support has been removed on trunk. widget/src/gtk2/nsWindow.cpp doesn't use PL_DHashTableInit or PL_NewDHashTable as far as I can tell. This bug doesn't look like a branch candidate to me. -> WONTFIX
Status: NEW → RESOLVED
Closed: 19 years ago
Component: GFX: Gtk → Widget: Gtk
Resolution: --- → WONTFIX
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.