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

This commit is contained in:
bratell@lysator.liu.se
2000-07-26 00:05:55 +00:00
parent 9d309259c1
commit 092f49fef3
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;