Closed
Bug 108808
Opened 23 years ago
Closed 23 years ago
CallQueryInterface() null-safety in form controls
Categories
(Core :: Layout: Form Controls, defect)
Tracking
()
VERIFIED
FIXED
People
(Reporter: john, Assigned: john)
Details
Attachments
(1 file)
1.65 KB,
patch
|
kinmoz
:
review+
kinmoz
:
superreview+
|
Details | Diff | Splinter Review |
I've gone through and found a few places where CallQueryInterface() is being called without setting the pointer to null first. This is bad, even if the chances are slim of it failing. Patch attached.
Assignee | ||
Comment 1•23 years ago
|
||
Comment 2•23 years ago
|
||
looks good r=rods
Comment on attachment 56856 [details] [diff] [review] Set stuff to null before CallQueryInterface() sr=kin@netscape.com So I noticed that the methods you touched don't set the value of the return arg aFrame/aScrollableView, in the case where the result of the QI is null, but they still return NS_OK. Should we be playing it safe and setting them to nsnull too, just in case the caller didn't initialize them?
Attachment #56856 -
Flags: superreview+
Attachment #56856 -
Flags: review+
Assignee | ||
Comment 4•23 years ago
|
||
I am not sure about that one ... is there a general contract for getter interfaces? My feeling was you were supposed to initialize to null outside. I think we should initialize outside or inside, but not both.
Assignee | ||
Comment 5•23 years ago
|
||
checked in.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•