From e5cc8044d031da1f3c24c53e51f2ea077b5156fe Mon Sep 17 00:00:00 2001 From: mathusummut Date: Thu, 27 Sep 2018 23:34:44 +0200 Subject: [PATCH] Test for fixing OOS checks --- .../sources/platform/common/platform_common.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/source/shared_lib/sources/platform/common/platform_common.cpp b/source/shared_lib/sources/platform/common/platform_common.cpp index a3be5d2b3..efa8107bd 100644 --- a/source/shared_lib/sources/platform/common/platform_common.cpp +++ b/source/shared_lib/sources/platform/common/platform_common.cpp @@ -2262,18 +2262,17 @@ namespace Shared { #ifndef _DISABLE_MEMORY_VAULT_CHECKS Checksum checksum; vaultList[ptr] = checksum.addInt(value); - #endif } void ValueCheckerVault::checkItemInVault(const void *ptr, int value) const { #ifndef _DISABLE_MEMORY_VAULT_CHECKS map::const_iterator iterFind = vaultList.find(ptr); - if (iterFind == vaultList.end()) - notifyValueChangedUnexpectedly(); - Checksum checksum; - if (iterFind->second != checksum.addInt(value)) - notifyValueChangedUnexpectedly(); + if (iterFind != vaultList.end()) { + Checksum checksum; + if (iterFind->second != checksum.addInt(value)) + notifyValueChangedUnexpectedly(); + } #endif }