VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Platform/Buffer.cpp
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2015-11-30 11:35:41 +0100
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2015-11-30 13:58:19 +0100
commitefa436974d8203485eec6faa1bf0116bb32f6fcd (patch)
tree97a5ef2eea0310a12db399151de7ca97dbd47ece /src/Platform/Buffer.cpp
parentcfadb231d24bd292a6ea3708b776bde8f06e50ab (diff)
downloadVeraCrypt-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/Buffer.cpp')
-rw-r--r--src/Platform/Buffer.cpp8
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 ()