Potential Memory Corruption in Release Build (#3559)

* Potential Memory Corruption in Release Build

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>

* @lumberyard-employee-dm suggested code

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>

* warnings as errors found in VS2022

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>

* simplifying some strucutres used and fixing a bug

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>

* some unused fixes for VS2022

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>

* fix for other platforms

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>

* fixes check used in unit tests to be case-insensitive
fixes memory leaks/invalid memory operations in AWSCore tests

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
Esteban Papp
2021-08-26 15:59:40 -07:00
committed by GitHub
parent 9f55212a19
commit 1be95a1e76
20 changed files with 93 additions and 108 deletions
+1 -1
View File
@@ -1293,7 +1293,6 @@ XmlString CXmlNode::getXMLUnsafe(int level, char* tmpBuffer, uint32 sizeOfTmpBuf
// TODO: those 2 saving functions are a bit messy. should probably make a separate one for the use of PlatformAPI
bool CXmlNode::saveToFile(const char* fileName)
{
const size_t chunkSizeBytes = (15 * 1024);
if (!fileName)
{
return false;
@@ -1310,6 +1309,7 @@ bool CXmlNode::saveToFile(const char* fileName)
gEnv->pCryPak->FClose(fileHandle);
return true;
#else
constexpr size_t chunkSizeBytes = (15 * 1024);
bool ret = saveToFile(fileName, chunkSizeBytes, fileHandle);
gEnv->pCryPak->FClose(fileHandle);
return ret;