mirror of
https://github.com/veracrypt/VeraCrypt
synced 2024-11-27 21:43:29 +01:00
Static Code Analysis : Correctly initialize member variables in various constructors
This commit is contained in:
parent
9bb962c8bb
commit
f19cfb3361
@ -375,6 +375,13 @@ namespace VeraCrypt
|
|||||||
SelectedEncryptionAlgorithmId (0),
|
SelectedEncryptionAlgorithmId (0),
|
||||||
VolumeHeaderValid (false)
|
VolumeHeaderValid (false)
|
||||||
{
|
{
|
||||||
|
HiddenOSCandidatePartition.IsGPT = FALSE;
|
||||||
|
HiddenOSCandidatePartition.Number = (size_t) -1;
|
||||||
|
DriveConfig.DriveNumber = -1;
|
||||||
|
DriveConfig.ExtraBootPartitionPresent = false;
|
||||||
|
DriveConfig.SystemLoaderPresent = false;
|
||||||
|
DriveConfig.InitialUnallocatedSpace = 0;
|
||||||
|
DriveConfig.TotalUnallocatedSpace = 0;
|
||||||
Elevator::AddReference();
|
Elevator::AddReference();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ namespace VeraCrypt
|
|||||||
class File
|
class File
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
File () : FileOpen (false) { }
|
File () : Elevated (false), FileOpen (false), FilePointerPosition(0), Handle(NULL), IsDevice(false) { }
|
||||||
File (string path, bool readOnly = false, bool create = false);
|
File (string path, bool readOnly = false, bool create = false);
|
||||||
~File () { Close(); }
|
~File () { Close(); }
|
||||||
|
|
||||||
|
@ -35,12 +35,12 @@ namespace VeraCrypt
|
|||||||
struct ErrorException : public Exception
|
struct ErrorException : public Exception
|
||||||
{
|
{
|
||||||
ErrorException (char *langId) : ErrLangId (langId) { }
|
ErrorException (char *langId) : ErrLangId (langId) { }
|
||||||
ErrorException (const wstring &errMsg) : ErrMsg (errMsg) { }
|
ErrorException (const wstring &errMsg) : ErrLangId(NULL), ErrMsg (errMsg) { }
|
||||||
|
|
||||||
void Show (HWND parent) const
|
void Show (HWND parent) const
|
||||||
{
|
{
|
||||||
if (ErrMsg.empty())
|
if (ErrMsg.empty())
|
||||||
::Error (ErrLangId);
|
::Error (ErrLangId? ErrLangId : "");
|
||||||
else
|
else
|
||||||
::ErrorDirect (ErrMsg.c_str());
|
::ErrorDirect (ErrMsg.c_str());
|
||||||
}
|
}
|
||||||
|
@ -69,7 +69,7 @@ namespace VeraCrypt
|
|||||||
|
|
||||||
struct SecurityTokenKeyfile
|
struct SecurityTokenKeyfile
|
||||||
{
|
{
|
||||||
SecurityTokenKeyfile () { }
|
SecurityTokenKeyfile () : Handle(CK_INVALID_HANDLE), SlotId(CK_UNAVAILABLE_INFORMATION) { Token.SlotId = CK_UNAVAILABLE_INFORMATION; Token.Flags = 0; }
|
||||||
SecurityTokenKeyfile (const SecurityTokenKeyfilePath &path);
|
SecurityTokenKeyfile (const SecurityTokenKeyfilePath &path);
|
||||||
|
|
||||||
operator SecurityTokenKeyfilePath () const;
|
operator SecurityTokenKeyfilePath () const;
|
||||||
@ -85,7 +85,8 @@ namespace VeraCrypt
|
|||||||
{
|
{
|
||||||
Pkcs11Exception (CK_RV errorCode = (CK_RV) -1)
|
Pkcs11Exception (CK_RV errorCode = (CK_RV) -1)
|
||||||
: ErrorCode (errorCode),
|
: ErrorCode (errorCode),
|
||||||
SubjectErrorCodeValid (false)
|
SubjectErrorCodeValid (false),
|
||||||
|
SubjectErrorCode( (uint64) -1)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -155,7 +156,7 @@ namespace VeraCrypt
|
|||||||
|
|
||||||
struct Pkcs11Session
|
struct Pkcs11Session
|
||||||
{
|
{
|
||||||
Pkcs11Session () : UserLoggedIn (false) { }
|
Pkcs11Session () : Handle (CK_UNAVAILABLE_INFORMATION), UserLoggedIn (false) { }
|
||||||
|
|
||||||
CK_SESSION_HANDLE Handle;
|
CK_SESSION_HANDLE Handle;
|
||||||
bool UserLoggedIn;
|
bool UserLoggedIn;
|
||||||
|
Loading…
Reference in New Issue
Block a user