VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common/BootEncryption.h
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2016-09-15 10:04:05 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2016-10-17 18:40:06 +0200
commit4dacedd9ccdbdc6a6e62d9fb86e9b2ea903a3629 (patch)
tree567350f56dd4ee4dd291d13199610d38dac51879 /src/Common/BootEncryption.h
parent66891638d51351fae5cd82a88c1a64661a025de0 (diff)
downloadVeraCrypt-4dacedd9ccdbdc6a6e62d9fb86e9b2ea903a3629.tar.gz
VeraCrypt-4dacedd9ccdbdc6a6e62d9fb86e9b2ea903a3629.zip
Windows: Replace XZip/XUnzip library with zlib and libzip and include the sources of these library into VeraCrypt source tree.
Diffstat (limited to 'src/Common/BootEncryption.h')
-rw-r--r--src/Common/BootEncryption.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/Common/BootEncryption.h b/src/Common/BootEncryption.h
index c8c9e29f..06da2bba 100644
--- a/src/Common/BootEncryption.h
+++ b/src/Common/BootEncryption.h
@@ -82,6 +82,19 @@ namespace VeraCrypt
~Buffer () { delete[] DataPtr; }
byte *Ptr () const { return DataPtr; }
size_t Size () const { return DataSize; }
+ void Resize (size_t newSize)
+ {
+ if (newSize > DataSize)
+ {
+ byte *tmp = new byte[newSize];
+ if (!tmp)
+ throw bad_alloc();
+ memcpy (tmp, DataPtr, DataSize);
+ delete [] DataPtr;
+ DataPtr = tmp;
+ }
+ DataSize = newSize;
+ }
protected:
byte *DataPtr;