Bug 520129 - crash: columnHeaderCells on ARIA grid cell of the grid without rows [@ nsWinUtils::ConvertToIA2Array], r=davidb

This commit is contained in:
Alexander Surkov 2009-10-05 14:41:56 +08:00
parent 926ee3ccfa
commit be5fce4aec

View File

@ -51,11 +51,17 @@ nsWinUtils::ConvertToIA2Array(nsIArray *aGeckoArray, IUnknown ***aIA2Array,
*aIA2Array = NULL;
*aIA2ArrayLen = 0;
if (!aGeckoArray)
return S_FALSE;
PRUint32 length = 0;
nsresult rv = aGeckoArray->GetLength(&length);
if (NS_FAILED(rv))
return GetHRESULT(rv);
if (length == 0)
return S_FALSE;
*aIA2Array =
static_cast<IUnknown**>(nsMemory::Alloc((length) * sizeof(IUnknown*)));
if (!*aIA2Array)