Skip to content

Commit

Permalink
Pointer initialization fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
pozitronik committed Aug 23, 2018
1 parent 3fa5bf2 commit d4e5e4b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions TCPasswordManagerHelper.pas
Expand Up @@ -3,7 +3,7 @@
{Обертка над обращениями к менеджеру паролей Total Commander}
interface

Uses Plugin_Types, Settings, Windows, SysUtils, AskPassword, {AskEncryptionPasswords,}MRC_Helper, Controls, Cipher;
Uses Plugin_Types, Settings, Windows, SysUtils, AskPassword, {AskEncryptionPasswords,}MRC_Helper, Controls, Cipher, WideStrUtils;

type

Expand Down Expand Up @@ -233,15 +233,20 @@ function TTCPasswordManager.StoreFileCryptPassword(AccountName: WideString): Wid
exit;
end;
end;

GetMem(buf, 1024);
ZeroMemory(buf, 1024);
buf := Addr(CurrentPassword[1]);
WStrCopy(buf, PWideChar(CurrentPassword));

if self.RequestHandleProc(RT_Password, PWideChar(Verb + ' encryption password'), 'New password:', buf, 1024) then
begin
CurrentPassword := buf;
self.SetPassword(crypt_id, CurrentPassword);
result := TFileCipher.CryptedGUID(CurrentPassword);
end;

FreeMem(buf);

end;

end.

0 comments on commit d4e5e4b

Please sign in to comment.