nsSocketTransportService::Run doesn't check the return value of PL_DHashTableInit

RESOLVED FIXED in mozilla1.6alpha

Status

()

defect
--
minor
RESOLVED FIXED
16 years ago
16 years ago

People

(Reporter: timeless, Assigned: darin.moz)

Tracking

Trunk
mozilla1.6alpha
x86
Windows 2000
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

(Reporter)

Description

16 years ago
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:

 558     gSocketThread = PR_GetCurrentThread();
 559
 560     //
 561     // Initialize hostname database
 562     //
 563     PL_DHashTableInit(&mHostDB, &ops, nsnull, sizeof(nsHostEntry), 0);
(Assignee)

Updated

16 years ago
Target Milestone: --- → mozilla1.5alpha

Comment 1

16 years ago
Posted patch patch. Splinter Review
(Reporter)

Comment 2

16 years ago
Comment on attachment 126857 [details] [diff] [review]
patch. 

you don't really need to clear ops because only Run uses the hashtable and it
cleans it up.
Attachment #126857 - Flags: superreview?(darin)
Attachment #126857 - Flags: review+
(Assignee)

Comment 3

16 years ago
thanks for the patch suresh... i've actually already incorporated (roughly) this
into some changes i am making to that function right now for another bug (bug
205726).
Depends on: 205726
(Assignee)

Updated

16 years ago
Attachment #126857 - Flags: superreview?(darin)
(Assignee)

Updated

16 years ago
Target Milestone: mozilla1.5alpha → mozilla1.5beta
(Assignee)

Updated

16 years ago
Target Milestone: mozilla1.5beta → mozilla1.6alpha
(Assignee)

Comment 4

16 years ago
this is fixed now that the patch for bug 205726 has landed.
Status: NEW → RESOLVED
Last Resolved: 16 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.