Merge pull request #13499 from hyperlogic/bug-fix/space-process-resets-crash

Guard against memory corruption in Space::processResets()
This commit is contained in:
Sam Gateau 2018-06-29 17:56:44 +02:00 committed by GitHub
commit 3435e7ca87
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -44,6 +44,11 @@ void Space::processResets(const Transaction::Resets& transactions) {
for (auto& reset : transactions) {
// Access the true item
auto proxyID = std::get<0>(reset);
// Guard against proxyID being past the end of the list.
if (proxyID < 0 || proxyID >= (int32_t)_proxies.size() || proxyID >= (int32_t)_owners.size()) {
continue;
}
auto& item = _proxies[proxyID];
// Reset the item with a new payload