Bug 1113005 - Copy only the necessary number of bytes from the source buffer; r=froydnj

--HG--
extra : rebase_source : 06c78b0ae291ac14d9433c7c7fe47907437f0da9
This commit is contained in:
Ehsan Akhgari 2014-12-19 13:12:34 -05:00
parent a522bf9f27
commit ed9800814c

View File

@ -505,7 +505,7 @@ nsTString_CharT::ReplaceSubstring( const self_type& aTarget, const self_type& aN
return;
if (oldData) {
// Copy all of the old data to the new buffer.
char_traits::copy(mData, oldData, XPCOM_MAX(mLength, newLength));
char_traits::copy(mData, oldData, XPCOM_MIN(mLength, newLength));
::ReleaseData(oldData, oldFlags);
}