Skip to content

Commit

Permalink
Fix uninitialized variables
Browse files Browse the repository at this point in the history
  • Loading branch information
visuve committed Sep 2, 2022
1 parent c0ff7a7 commit 59e59fd
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 3 deletions.
9 changes: 8 additions & 1 deletion src/Core/VolumeCreator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,14 @@
namespace VeraCrypt
{
VolumeCreator::VolumeCreator ()
: SizeDone (0)
: SizeDone (0),
AbortRequested (false),
CreationInProgress (false),
DataStart (0),
HostSize (0),
VolumeSize (0),
WriteOffset (0),
mProgressInfo ({})
{
}

Expand Down
2 changes: 1 addition & 1 deletion src/Main/StringFormatter.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace VeraCrypt
class StringFormatterArg
{
public:
StringFormatterArg () : Empty (true) { }
StringFormatterArg () : Empty (true), Referenced (false) { }

StringFormatterArg (const char c) : Empty (false) { string s; s += c; StringArg = StringConverter::ToWide (s); }
StringFormatterArg (const wchar_t c) : Empty (false), Referenced (false), StringArg (c) { }
Expand Down
22 changes: 21 additions & 1 deletion src/Volume/VolumeInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,27 @@ namespace VeraCrypt
class VolumeInfo : public Serializable
{
public:
VolumeInfo () { }
VolumeInfo ()
: EncryptionAlgorithmBlockSize (0),
EncryptionAlgorithmKeySize (0),
EncryptionAlgorithmMinBlockSize (0),
HiddenVolumeProtectionTriggered (false),
MinRequiredProgramVersion (0),
Pkcs5IterationCount (0),
ProgramVersion (0),
Protection (VolumeProtection::None),
SerialInstanceNumber (0),
Size (0),
SystemEncryption (false),
TopWriteOffset (0),
TotalDataRead (0),
TotalDataWritten (0),
Type (VolumeType::Unknown),
TrueCryptMode (false),
Pim (0)
{
}

virtual ~VolumeInfo () { }

TC_SERIALIZABLE (VolumeInfo);
Expand Down
4 changes: 4 additions & 0 deletions src/Volume/VolumeLayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
namespace VeraCrypt
{
VolumeLayout::VolumeLayout ()
: BackupHeaderOffset (0),
HeaderOffset (0),
HeaderSize (0),
Type (VolumeType::Unknown)
{
}

Expand Down

0 comments on commit 59e59fd

Please sign in to comment.