mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 14:22:01 +00:00
Bug 283509 OOM crasher [@ mozEnglishWordUtils::FromRootForm]
patch by dewildt@gmail.com r=timeless sr=mscott a=chofmann
This commit is contained in:
parent
14bcea2092
commit
b42edae703
@ -273,6 +273,10 @@ NS_IMETHODIMP mozEnglishWordUtils::FromRootForm(const PRUnichar *aWord, const PR
|
||||
for(PRUint32 i = 0; i < icount; ++i) {
|
||||
length = nsCRT::strlen(iwords[i]);
|
||||
tmpPtr[i] = (PRUnichar *) nsMemory::Alloc(sizeof(PRUnichar) * (length + 1));
|
||||
if (NS_UNLIKELY(!tmpPtr[i])) {
|
||||
NS_FREE_XPCOM_ALLOCATED_POINTER_ARRAY(i, tmpPtr);
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
memcpy(tmpPtr[i], iwords[i], (length + 1) * sizeof(PRUnichar));
|
||||
|
||||
nsAutoString capTest(tmpPtr[i]);
|
||||
|
Loading…
Reference in New Issue
Block a user