Files
nyc3/src
Wladimir J. van der Laan 10bee0dd4f Merge #11284: Fix invalid memory access in CScript::operator+= (guidovranken, ajtowns)
d601f16 Fix invalid memory access in CScript::operator+= (Anthony Towns)

Pull request description:

  This is a fix for #11114 -- invoking "s += s" gets turned into "s.insert(s.end(), s.begin(), s.end())" which can result in an invalid memory access is s.capacity() < 2*s.size() (because s gets resized and possibly moved, so s.begin() and s.end() become invalid references when reading the values to be appended).

  The fix is straightforward: reserve enough space in advance, so that insert() doesn't need to resize and thus its arguments remain valid.

  A simple test case is added as well; though you probably need to run it via valgrind to actually catch the problem when it's not fixed...

Tree-SHA512: 4720d0c17463fdc43b344c45fe603423d20b30d48da1b9d85eeedc505d7f34db1ed5495ef1556459ae962a94717e3c6e8fc441763771901efea210d01322b7ef
2017-10-02 14:46:47 +02:00
..
2017-06-22 19:18:10 +03:00
2017-07-15 14:28:40 +02:00
2017-09-07 11:17:35 +08:00
2017-09-29 14:50:30 +08:00
2017-06-09 10:25:26 +02:00
2017-09-21 23:40:33 -07:00
2017-06-09 10:25:26 +02:00
2017-09-18 13:47:47 -04:00
2017-09-06 21:44:18 +02:00
2017-07-22 09:55:57 +02:00