Closed Bug 60718 Opened 24 years ago Closed 24 years ago

Missing check for null in nsPluginArray.cpp

Categories

(Core Graveyard :: Plug-ins, defect, P3)

x86
Linux
defect

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: dougt, Assigned: dougt)

Details

cvs server: Diffing . Index: nsPluginArray.cpp =================================================================== RCS file: /cvsroot/mozilla/dom/src/base/nsPluginArray.cpp,v retrieving revision 1.9 diff -u -r1.9 nsPluginArray.cpp --- nsPluginArray.cpp 2000/08/23 17:25:50 1.9 +++ nsPluginArray.cpp 2000/11/20 05:44:20 @@ -106,7 +106,9 @@ NS_IMETHODIMP PluginArrayImpl::GetLength(PRUint32* aLength) { - return mPluginHost->GetPluginCount(aLength); + if (mPluginHost && NS_SUCCEEDED(mPluginHost->GetPluginCount(aLength))) + return NS_OK; + return NS_ERROR_FAILURE; } NS_IMETHODIMP PluginArrayImpl::Item(PRUint32 aIndex, nsIDOMPlugin** aReturn) @@ -163,7 +165,7 @@ nsresult PluginArrayImpl::GetPlugins() { - nsresult rv = mPluginHost->GetPluginCount(&mPluginCount); + nsresult rv = GetLength(&mPluginCount); if (rv == NS_OK) { mPluginArray = new nsIDOMPlugin*[mPluginCount]; if (mPluginArray != nsnull) { Jud, can I get a r=? beard, you touched this area last could you sr?
r=valeski. should this land on the embedding branch too?
Vidur can you please sr=?
Summary: Missing check for null. → Missing check for null in nsPluginArray.cpp
sr=vidur. Thanks for catching this.
fix checked in.
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
verified that the patch went in version 1.11 in the tree.
Status: RESOLVED → VERIFIED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.