Self-assignment in nsTArray_Impl causes memory-safety bug
- Fixed in 12 days
- Paid in 17 days
- Disclosed after 12 days
Assigning an array object based upon nsTArray_Impl to itself causes the destruction of the array's elements, followed by the construction of new elements from the memory that contained the destroyed elements. If the element type has a nontrivial destructor, this almost certainly results in the construction of invalid new elements, such as those containing pointers to unowned memory.
The bug is that the copy-assignment operator does not check for self-assignment.
I do not know whether any code actually does such a self-assignment.
There is also a similar bug in the move-assignment operator, which is less serious because it clears the object, then assigns it to itself.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
What is known
A high-severity memory corruption bug in XPCOM. Mozilla made it public on 22 July 2015 as CVE-2015-4489.
About Memory corruption
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
What is Memory corruption?
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.