зеркало из https://github.com/mozilla/gecko-dev.git
Bug 40027, reads past buffer in nsString::ToCString, r,a=waterson
This commit is contained in:
Родитель
777b97104b
Коммит
c0a8b69048
|
@ -689,7 +689,7 @@ char* nsCString::ToCString(char* aBuf, PRUint32 aBufLength,PRUint32 anOffset) co
|
|||
|
||||
CBufDescriptor theDescr(aBuf,PR_TRUE,aBufLength,0);
|
||||
nsCAutoString temp(theDescr);
|
||||
temp.Assign(*this,aBufLength-1);
|
||||
temp.Assign(*this, PR_MIN(mLength, aBufLength-1));
|
||||
temp.mStr=0;
|
||||
}
|
||||
return aBuf;
|
||||
|
|
|
@ -689,7 +689,7 @@ char* nsCString::ToCString(char* aBuf, PRUint32 aBufLength,PRUint32 anOffset) co
|
|||
|
||||
CBufDescriptor theDescr(aBuf,PR_TRUE,aBufLength,0);
|
||||
nsCAutoString temp(theDescr);
|
||||
temp.Assign(*this,aBufLength-1);
|
||||
temp.Assign(*this, PR_MIN(mLength, aBufLength-1));
|
||||
temp.mStr=0;
|
||||
}
|
||||
return aBuf;
|
||||
|
|
|
@ -689,7 +689,7 @@ char* nsCString::ToCString(char* aBuf, PRUint32 aBufLength,PRUint32 anOffset) co
|
|||
|
||||
CBufDescriptor theDescr(aBuf,PR_TRUE,aBufLength,0);
|
||||
nsCAutoString temp(theDescr);
|
||||
temp.Assign(*this,aBufLength-1);
|
||||
temp.Assign(*this, PR_MIN(mLength, aBufLength-1));
|
||||
temp.mStr=0;
|
||||
}
|
||||
return aBuf;
|
||||
|
|
Загрузка…
Ссылка в новой задаче