зеркало из https://github.com/mozilla/gecko-dev.git
Fix to ensure we don't go past array bounds in ScanNormalUnicodeText() b=52722 r=buster a=karnaze
This commit is contained in:
Родитель
290a07f768
Коммит
641809a1df
|
@ -438,6 +438,12 @@ nsTextTransformer::ScanNormalUnicodeText_F(PRBool aForLineBreak,
|
|||
firstChar = ' ';
|
||||
*aWasTransformed = PR_TRUE;
|
||||
}
|
||||
nsresult rv = mTransformBuf.GrowTo(mBufferPos + 1);
|
||||
if (NS_FAILED(rv)) {
|
||||
*aWordLen = 0;
|
||||
return offset - 1;
|
||||
}
|
||||
|
||||
mTransformBuf.mBuffer[mBufferPos++] = firstChar;
|
||||
|
||||
if (!breakBetween) {
|
||||
|
@ -493,6 +499,11 @@ nsTextTransformer::ScanNormalUnicodeText_F(PRBool aForLineBreak,
|
|||
firstChar = ' ';
|
||||
*aWasTransformed = PR_TRUE;
|
||||
}
|
||||
nsresult rv = mTransformBuf.GrowTo(mBufferPos + 1);
|
||||
if (NS_FAILED(rv)) {
|
||||
*aWordLen = 0;
|
||||
return offset - 1;
|
||||
}
|
||||
mTransformBuf.mBuffer[mBufferPos++] = firstChar;
|
||||
}
|
||||
|
||||
|
|
|
@ -438,6 +438,12 @@ nsTextTransformer::ScanNormalUnicodeText_F(PRBool aForLineBreak,
|
|||
firstChar = ' ';
|
||||
*aWasTransformed = PR_TRUE;
|
||||
}
|
||||
nsresult rv = mTransformBuf.GrowTo(mBufferPos + 1);
|
||||
if (NS_FAILED(rv)) {
|
||||
*aWordLen = 0;
|
||||
return offset - 1;
|
||||
}
|
||||
|
||||
mTransformBuf.mBuffer[mBufferPos++] = firstChar;
|
||||
|
||||
if (!breakBetween) {
|
||||
|
@ -493,6 +499,11 @@ nsTextTransformer::ScanNormalUnicodeText_F(PRBool aForLineBreak,
|
|||
firstChar = ' ';
|
||||
*aWasTransformed = PR_TRUE;
|
||||
}
|
||||
nsresult rv = mTransformBuf.GrowTo(mBufferPos + 1);
|
||||
if (NS_FAILED(rv)) {
|
||||
*aWordLen = 0;
|
||||
return offset - 1;
|
||||
}
|
||||
mTransformBuf.mBuffer[mBufferPos++] = firstChar;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче