mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-08-15 08:53:07 +09:00
[html parser] Check for integer overflow when computing new buffer sizes.
This commit is contained in:
parent
d86d1256bc
commit
5934c74a3f
7 changed files with 36 additions and 13 deletions
|
|
@ -743,7 +743,7 @@ void
|
|||
nsHtml5MetaScanner::addToBuffer(int32_t c)
|
||||
{
|
||||
if (strBufLen == strBuf.length) {
|
||||
jArray<char16_t,int32_t> newBuf = jArray<char16_t,int32_t>::newJArray(strBuf.length + (strBuf.length << 1));
|
||||
jArray<char16_t,int32_t> newBuf = jArray<char16_t,int32_t>::newJArray(nsHtml5Portability::checkedAdd(strBuf.length, (strBuf.length << 1)));
|
||||
nsHtml5ArrayCopy::arraycopy(strBuf, newBuf, strBuf.length);
|
||||
strBuf = newBuf;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue