diff --git a/NanaZip.Core/Wrappers/Sha256Wrapper.cpp b/NanaZip.Core/Wrappers/Sha256Wrapper.cpp index 578257bb..f652eb58 100644 --- a/NanaZip.Core/Wrappers/Sha256Wrapper.cpp +++ b/NanaZip.Core/Wrappers/Sha256Wrapper.cpp @@ -10,12 +10,20 @@ #include "Sha256Wrapper.h" +#include + BoolInt Sha256_SetFunction( CSha256* p, unsigned algo) { - UNREFERENCED_PARAMETER(p); UNREFERENCED_PARAMETER(algo); + + if (p) + { + // Workaround for using the uninitialized memory. + std::memset(p, 0, sizeof(CSha256)); + } + // Only return true because it's a wrapper to K7Pal. return True; } diff --git a/NanaZip.Core/Wrappers/Sha512Wrapper.cpp b/NanaZip.Core/Wrappers/Sha512Wrapper.cpp index 4861da14..c7fd023d 100644 --- a/NanaZip.Core/Wrappers/Sha512Wrapper.cpp +++ b/NanaZip.Core/Wrappers/Sha512Wrapper.cpp @@ -10,12 +10,20 @@ #include "Sha512Wrapper.h" +#include + BoolInt Sha512_SetFunction( CSha512* p, unsigned algo) { - UNREFERENCED_PARAMETER(p); UNREFERENCED_PARAMETER(algo); + + if (p) + { + // Workaround for using the uninitialized memory. + std::memset(p, 0, sizeof(CSha512)); + } + // Only return true because it's a wrapper to K7Pal. return True; }