diff options
author | Rozhuk Ivan <rozhuk.im@gmail.com> | 2014-12-01 00:07:01 +0000 |
---|---|---|
committer | Rozhuk Ivan <rozhuk.im@gmail.com> | 2014-12-01 00:07:01 +0000 |
commit | b2fad485cd5b41744ef0cc4a02722c021afd926c (patch) | |
tree | aa19403cd699066600e8306be8ad33e4a17fba6f /plugins/CryptoPP | |
parent | fc62f1f1e1f8af40a1f7efe0ba3afc358fb66ef3 (diff) |
ZeroMemory -> memset, few bugs fised
git-svn-id: http://svn.miranda-ng.org/main/trunk@11184 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/CryptoPP')
-rw-r--r-- | plugins/CryptoPP/src/GPGw/gpg_main.cpp | 18 | ||||
-rw-r--r-- | plugins/CryptoPP/src/GPGw/keys.cpp | 2 | ||||
-rw-r--r-- | plugins/CryptoPP/src/GPGw/passdialog.cpp | 2 | ||||
-rw-r--r-- | plugins/CryptoPP/src/GPGw/passphrases.cpp | 2 | ||||
-rw-r--r-- | plugins/CryptoPP/src/GPGw/pipeexec.cpp | 4 | ||||
-rw-r--r-- | plugins/CryptoPP/src/GPGw/userdialog.cpp | 4 |
6 files changed, 16 insertions, 16 deletions
diff --git a/plugins/CryptoPP/src/GPGw/gpg_main.cpp b/plugins/CryptoPP/src/GPGw/gpg_main.cpp index 61c076e8df..ffb6a65e02 100644 --- a/plugins/CryptoPP/src/GPGw/gpg_main.cpp +++ b/plugins/CryptoPP/src/GPGw/gpg_main.cpp @@ -168,7 +168,7 @@ LPSTR __cdecl _gpg_encrypt(LPCSTR message, LPCSTR keyid) if(strlen(keyid))
{
- ZeroMemory(buffer, sizeof(buffer));
+ memset(buffer, 0, sizeof(buffer));
gpgresult=gpgEncrypt(buffer, keyid, message);
if(gpgresult!=gpgSuccess)
@@ -205,7 +205,7 @@ LPSTR __cdecl _gpg_decrypt(LPCSTR message) replace(buffer, "\r", "");
replace(buffer, "\n", txtcrlf);
- ZeroMemory(keyuserid, sizeof(keyuserid));
+ memset(keyuserid, 0, sizeof(keyuserid));
gpgresult=gpgDetectUserID(keyuserid, buffer);
storedpassphrase=NULL;
@@ -224,7 +224,7 @@ LPSTR __cdecl _gpg_decrypt(LPCSTR message) if(storedpassphrase!=NULL)
{
strcpy(passphrase, storedpassphrase);
- ZeroMemory(plaintext, sizeof(plaintext));
+ memset(plaintext, 0, sizeof(plaintext));
gpgresult=gpgDecrypt(plaintext, buffer, passphrase);
}
else gpgresult=gpgUnknownError;
@@ -237,9 +237,9 @@ LPSTR __cdecl _gpg_decrypt(LPCSTR message) if(dlgresult==IDOK)
{
strcpy(passphrase, dlgpassphrase);
- ZeroMemory(dlgpassphrase, passphrasesize);
+ memset(dlgpassphrase, 0, passphrasesize);
strcat(passphrase, txtcrlf);
- ZeroMemory(plaintext, sizeof(plaintext));
+ memset(plaintext, 0, sizeof(plaintext));
gpgresult=gpgDecrypt(plaintext, buffer, passphrase);
}
}
@@ -252,7 +252,7 @@ LPSTR __cdecl _gpg_decrypt(LPCSTR message) if ( gpgresult==gpgSuccess && useridvalid==TRUE)
addPassphrase(keyuserid, passphrase);
- ZeroMemory(passphrase, sizeof(passphrase));
+ memset(passphrase, 0, sizeof(passphrase));
decmessagelen = strlen(buffer)+1;
decmessage = (char *) LocalAlloc(LPTR,decmessagelen);
@@ -273,11 +273,11 @@ int __cdecl _gpg_select_keyid(HWND hdlg, LPSTR keyid) {
int dlgresult;
- ZeroMemory(keyid, keyidsize);
+ memset(keyid, 0, keyidsize);
dlgresult=DialogBoxParam(g_hInst, MAKEINTRESOURCE(IDD_SELECTKEY), hdlg, UserIdDialogProcedure, (LPARAM)keyid);
if(dlgresult!=IDOK)
- ZeroMemory(keyid, keyidsize);
+ memset(keyid, 0, keyidsize);
return (dlgresult==IDOK);
}
@@ -325,7 +325,7 @@ LPSTR GetEnvValue(LPCSTR szName) BOOL ShowSelectExecDlg(LPSTR path)
{
OPENFILENAME ofn;
- ZeroMemory(&ofn,sizeof(ofn));
+ memset(&ofn, 0, sizeof(ofn));
ofn.lpstrFile = GetRegValue(HKEY_CURRENT_USER,"Software\\GNU\\GnuPG","gpgProgram");
if ( ofn.lpstrFile && existsFile(ofn.lpstrFile) ) {
diff --git a/plugins/CryptoPP/src/GPGw/keys.cpp b/plugins/CryptoPP/src/GPGw/keys.cpp index 19606d446a..74674bedd3 100644 --- a/plugins/CryptoPP/src/GPGw/keys.cpp +++ b/plugins/CryptoPP/src/GPGw/keys.cpp @@ -24,7 +24,7 @@ void updateKeyUserIDs(const int atype) releaseKeyUserIDs(atype);
initKeyUserIDs(atype);
- ZeroMemory(buffer, sizeof(buffer));
+ memset(buffer, 0, sizeof(buffer));
if(atype==publickeyuserid) gpgresult=gpgListPublicKeys(buffer);
else gpgresult=gpgListSecretKeys(buffer);
diff --git a/plugins/CryptoPP/src/GPGw/passdialog.cpp b/plugins/CryptoPP/src/GPGw/passdialog.cpp index 8dfde8e09b..08ca1678a4 100644 --- a/plugins/CryptoPP/src/GPGw/passdialog.cpp +++ b/plugins/CryptoPP/src/GPGw/passdialog.cpp @@ -14,7 +14,7 @@ INT_PTR CALLBACK PassphraseDialogProcedure(HWND hdlg, UINT msg, WPARAM wparam, L switch(LOWORD(wparam))
{
case IDOK:
- ZeroMemory(dlgpassphrase, sizeof(dlgpassphrase));
+ memset(dlgpassphrase, 0, sizeof(dlgpassphrase));
GetDlgItemText(hdlg, IDC_PASSPHRASE, dlgpassphrase, SIZEOF(dlgpassphrase));
case IDCANCEL:
EndDialog(hdlg, wparam);
diff --git a/plugins/CryptoPP/src/GPGw/passphrases.cpp b/plugins/CryptoPP/src/GPGw/passphrases.cpp index 847472f5ac..6a88358370 100644 --- a/plugins/CryptoPP/src/GPGw/passphrases.cpp +++ b/plugins/CryptoPP/src/GPGw/passphrases.cpp @@ -18,7 +18,7 @@ void releasePassphrases(void) int i;
for(i=0; i<passphrasecount; i++)
- ZeroMemory(passphrases[i].passphrase, sizeof(passphrases[i].passphrase));
+ memset(passphrases[i].passphrase, 0, sizeof(passphrases[i].passphrase));
free(passphrases);
}
diff --git a/plugins/CryptoPP/src/GPGw/pipeexec.cpp b/plugins/CryptoPP/src/GPGw/pipeexec.cpp index fdefb147d6..3a04fd1697 100644 --- a/plugins/CryptoPP/src/GPGw/pipeexec.cpp +++ b/plugins/CryptoPP/src/GPGw/pipeexec.cpp @@ -6,7 +6,7 @@ BOOL isWindowsNT(void) BOOL result;
OSVERSIONINFO ovi;
- ZeroMemory(&ovi, sizeof(ovi));
+ memset(&ovi, 0, sizeof(ovi));
ovi.dwOSVersionInfoSize=sizeof(OSVERSIONINFO);
GetVersionEx(&ovi);
@@ -53,7 +53,7 @@ pxResult pxExecute(char *acommandline, char *ainput, char **aoutput, LPDWORD aex LogMessage("commandline:\n", acommandline, "\n");
- ZeroMemory(&securityattributes, sizeof(securityattributes));
+ memset(&securityattributes, 0, sizeof(securityattributes));
securityattributes.nLength=sizeof(SECURITY_ATTRIBUTES);
securityattributes.bInheritHandle=TRUE;
diff --git a/plugins/CryptoPP/src/GPGw/userdialog.cpp b/plugins/CryptoPP/src/GPGw/userdialog.cpp index 0227a5d549..a6f6cea17f 100644 --- a/plugins/CryptoPP/src/GPGw/userdialog.cpp +++ b/plugins/CryptoPP/src/GPGw/userdialog.cpp @@ -18,7 +18,7 @@ INT_PTR CALLBACK UserIdDialogProcedure(HWND hdlg, UINT msg, WPARAM wparam, LPARA static int iColWidth[] = { 110, 255 };
keyid = (char *)lparam;
- ZeroMemory(&lvc,sizeof(LVCOLUMN));
+ memset(&lvc, 0, sizeof(LVCOLUMN));
lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
lvc.fmt = LVCFMT_LEFT;
for (i = 0; i < 2; i++) {
@@ -63,7 +63,7 @@ void RefreshListView(HWND hLV) { int i;
ListView_DeleteAllItems(hLV);
- ZeroMemory(&lvi,sizeof(LVITEM));
+ memset(&lvi, 0, sizeof(LVITEM));
lvi.mask = LVIF_TEXT;
for (i = 0; i < getKeyUserIDCount(publickeyuserid); i++) {
|