diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2015-11-30 11:35:41 +0100 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2015-11-30 13:58:19 +0100 |
commit | efa436974d8203485eec6faa1bf0116bb32f6fcd (patch) | |
tree | 97a5ef2eea0310a12db399151de7ca97dbd47ece /src/Platform | |
parent | cfadb231d24bd292a6ea3708b776bde8f06e50ab (diff) | |
download | VeraCrypt-efa436974d8203485eec6faa1bf0116bb32f6fcd.tar.gz VeraCrypt-efa436974d8203485eec6faa1bf0116bb32f6fcd.zip |
Linux/MacOSX: Implement Unicode passwords suppport. Make validation of parameters in GUI more robust.
Diffstat (limited to 'src/Platform')
-rw-r--r-- | src/Platform/Buffer.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Platform/Buffer.cpp b/src/Platform/Buffer.cpp index 6fd8a01a..f0b7b693 100644 --- a/src/Platform/Buffer.cpp +++ b/src/Platform/Buffer.cpp @@ -58,11 +58,15 @@ namespace VeraCrypt void Buffer::CopyFrom (const ConstBufferPtr &bufferPtr)
{
if (!IsAllocated ())
- Allocate (bufferPtr.Size());
+ {
+ if (bufferPtr.Size())
+ Allocate (bufferPtr.Size());
+ }
else if (bufferPtr.Size() > DataSize)
throw ParameterTooLarge (SRC_POS);
- Memory::Copy (DataPtr, bufferPtr.Get(), bufferPtr.Size());
+ if (bufferPtr.Size())
+ Memory::Copy (DataPtr, bufferPtr.Get(), bufferPtr.Size());
}
void Buffer::Erase ()
|