fix 156967 using stand-alone msg window can cause memory corruption/crashes r=naving, sr=sspitzer, a=asa

This commit is contained in:
bienvenu%netscape.com 2002-07-11 21:25:47 +00:00
parent 9896d08d55
commit 6e02745ae6
2 changed files with 2 additions and 2 deletions

View File

@ -267,7 +267,7 @@ void nsUInt32Array::CopyArray(nsUInt32Array &oldA)
if (m_pData)
PR_Free(m_pData);
m_nSize = oldA.m_nSize;
m_nMaxSize = oldA.m_nMaxSize;
m_nMaxSize = oldA.m_nSize;
m_pData = (PRUint32 *)PR_Malloc(m_nSize * sizeof(PRUint32));
if (m_pData)
memcpy(m_pData, oldA.m_pData, m_nSize * sizeof(PRUint32));

View File

@ -144,7 +144,7 @@ void nsUint8Array::CopyArray(nsUint8Array &aSrcArray)
{
PR_FREEIF(m_pData);
m_nSize = aSrcArray.m_nSize;
m_nMaxSize = aSrcArray.m_nMaxSize;
m_nMaxSize = aSrcArray.m_nSize;
m_pData = (PRUint8*)PR_Malloc(m_nSize * sizeof(PRUint8));
if (m_pData)
memcpy(m_pData, aSrcArray.m_pData, m_nSize * sizeof(PRUint8));