Browse Source

Always initialize output parameter

Source commit: 2fa9ab884adbd5e962d88698b1a4989f7d7f7421
Martin Prikryl 5 years ago
parent
commit
717d40126e
2 changed files with 2 additions and 1 deletions
  1. 1 0
      source/core/Common.cpp
  2. 1 1
      source/core/Terminal.cpp

+ 1 - 0
source/core/Common.cpp

@@ -3269,6 +3269,7 @@ void __fastcall ParseCertificate(const UnicodeString & Path,
 {
   Certificate = NULL;
   PrivateKey = NULL;
+  WrongPassphrase = false;
   bool HasPassphrase = !Passphrase.IsEmpty();
 
   FILE * File;

+ 1 - 1
source/core/Terminal.cpp

@@ -7830,7 +7830,7 @@ bool __fastcall TTerminal::LoadTlsCertificate(X509 *& Certificate, EVP_PKEY *& P
     {
       Retry = false;
 
-      bool WrongPassphrase = false;
+      bool WrongPassphrase;
       ParseCertificate(SessionData->TlsCertificateFile, Passphrase, Certificate, PrivateKey, WrongPassphrase);
       if (WrongPassphrase)
       {