2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 06:27:43 +00:00

Buffer overrun bug fixes

This commit is contained in:
Jack Andersen
2017-11-27 16:48:24 -10:00
parent f60097b7e3
commit 31ccb48246
5 changed files with 13 additions and 7 deletions

View File

@@ -316,7 +316,7 @@ public:
if (base::x0_size == N)
Log.report(logvisor::Fatal, "insert() called on full rstl::reserved_vector.");
#endif
auto target_it = base::_const_cast_iterator(pos) - 1;
auto target_it = base::_const_cast_iterator(pos);
if (pos == base::cend())
{
::new (static_cast<void*>(std::addressof(base::_value(base::x0_size)))) T(value);
@@ -339,7 +339,7 @@ public:
if (base::x0_size == N)
Log.report(logvisor::Fatal, "insert() called on full rstl::reserved_vector.");
#endif
auto target_it = base::_const_cast_iterator(pos) - 1;
auto target_it = base::_const_cast_iterator(pos);
if (pos == base::cend())
{
::new (static_cast<void*>(std::addressof(base::_value(base::x0_size)))) T(std::forward<T>(value));
@@ -527,7 +527,7 @@ public:
if (base::x0_size == N)
Log.report(logvisor::Fatal, "insert() called on full rstl::reserved_vector.");
#endif
auto target_it = base::_const_cast_iterator(pos) - 1;
auto target_it = base::_const_cast_iterator(pos);
if (pos == base::cend())
{
*target_it = value;
@@ -548,7 +548,7 @@ public:
if (base::x0_size == N)
Log.report(logvisor::Fatal, "insert() called on full rstl::reserved_vector.");
#endif
auto target_it = base::_const_cast_iterator(pos) - 1;
auto target_it = base::_const_cast_iterator(pos);
if (pos == base::cend())
{
*target_it = std::forward<T>(value);