Closed Bug 550902 Opened 10 years ago Closed 10 years ago

rv used uninitialized in BaseStubConstructor if nsGlobalNameStruct::eTypeClassConstructor and FindConstructorFunc fails

Categories

(Core :: DOM: Core & HTML, defect)

x86
Linux
defect
Not set

Tracking

()

RESOLVED FIXED

People

(Reporter: timeless, Assigned: timeless)

References

(Blocks 1 open bug, )

Details

(Keywords: coverity)

Attachments

(1 file)

5178 BaseStubConstructor(nsIWeakReference* aWeakOwner,
5182   nsresult rv;

5184   if (name_struct->mType == nsGlobalNameStruct::eTypeClassConstructor) {
5188     if (contractid) {
5190     }
5191     else {
5192       nsDOMConstructorFunc func = FindConstructorFunc(ci_data);
5193       if (func) {
5194         rv = func(getter_AddRefs(native));
5197   } else if (...
5199   } else if (...
5201   } else {
5203   }

this might or might not be true (it should be):
5204   if (NS_FAILED(rv)) {
5205     NS_ERROR("Failed to create the object");
5206     return rv;

or this might be called with null native:
5214 	  rv = nsDOMGenericSH::WrapNative(cx, obj, native, PR_TRUE, rval);
Attached patch proposalSplinter Review
Assignee: nobody → timeless
Status: NEW → ASSIGNED
Attachment #431181 - Flags: review?(peterv)
Attachment #431181 - Flags: review?(peterv) → review+
http://hg.mozilla.org/mozilla-central/rev/df79eac381aa
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.