Closed Bug 131081 Opened 23 years ago Closed 23 years ago

nsComponentManagerImpl::ContractIDToCID is broken

Categories

(Core :: XPCOM, defect)

defect
Not set
major

Tracking

()

VERIFIED DUPLICATE of bug 135966

People

(Reporter: mef123, Assigned: dougt)

Details

Hi, The current (Mozilla 0.9.9) implementation of ContractIDToCID is broken: (from nsComponentManager.cpp) NS_IMETHODIMP nsComponentManagerImpl::ContractIDToCID(const char *aContractID, nsCID * *_retval) { nsCID aCID; nsresult rv = ContractIDToClassID(aContractID, &aCID); if (NS_FAILED(rv)) return rv; // not sure about this... FIX *_retval = (nsCID*) nsMemory::Alloc(sizeof(nsCID)); *_retval = &aCID; return NS_OK; } This sets retval to point to the stack, which vanishes when the function returns. "*_retval = &aCID" should be replaced with "**_retval = aCID" in order to fill the returned CID properly. Mark Follett
Duplicate of "nsComponentManagerImpl::ContractIDToCID very broken" (fixed on trunk) *** This bug has been marked as a duplicate of 135966 ***
Severity: normal → major
Status: UNCONFIRMED → RESOLVED
Closed: 23 years ago
Resolution: --- → DUPLICATE
hm, I did search for a bug before I filed a new one, why didn't I find this one?
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.