Bug 40027, reads past buffer in nsString::ToCString, r,a=waterson

git-svn-id: svn://10.0.0.236/trunk@74784 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bratell%lysator.liu.se
2000-07-26 00:05:55 +00:00
parent e56fde15e9
commit 30ea99bee8
3 changed files with 3 additions and 3 deletions

View File

@@ -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;