aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7>2011-08-17 16:54:24 +0000
committergerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7>2011-08-17 16:54:24 +0000
commit5edf55b717b89f5297ff27de21ab6d72c46a768e (patch)
tree12dfa085210356b0dadb228ae79492204f4512ba
parente5504262f912e2e17e2a0951fb98a0e852e39777 (diff)
The MSDN page for ZeroMemory recommends using SecureZeroMemory instead,
so do so. Add ZeroMemory to checkAPIs.pl. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@38584 f5534014-38df-0310-8fa8-9805f1628bb7
-rw-r--r--packaging/u3/win32/u3util.c16
-rwxr-xr-xtools/checkAPIs.pl3
-rw-r--r--win32/file_dlg_win32.c17
3 files changed, 19 insertions, 17 deletions
diff --git a/packaging/u3/win32/u3util.c b/packaging/u3/win32/u3util.c
index 5f1645325d..bb007833cb 100644
--- a/packaging/u3/win32/u3util.c
+++ b/packaging/u3/win32/u3util.c
@@ -308,9 +308,9 @@ void ExecuteAndWait(char *buffer)
STARTUPINFO si;
PROCESS_INFORMATION pi;
- ZeroMemory(&si, sizeof(si));
+ SecureZeroMemory(&si, sizeof(si));
si.cb = sizeof(si);
- ZeroMemory(&pi, sizeof(pi));
+ SecureZeroMemory(&pi, sizeof(pi));
if(CreateProcess(NULL, buffer, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) {
/* wait for the uninstall to finish */
@@ -378,7 +378,7 @@ void uninstall(char *regkey, char *u3installed, char *uninstall)
buffer,
"Uninstall",
MB_YESNO|MB_TOPMOST|MB_ICONQUESTION);
-#endif
+#endif
/* we have an uninstall string */
ExecuteAndWait(buffer);
@@ -394,7 +394,7 @@ void winpcap_auto_start()
char buffer[BUFSIZ+1];
int buflen = 0;
DWORD startVal = NPF_START_VAL;
-
+
if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, WINDOWS_VERSION_KEY, 0, (KEY_READ), &key) == ERROR_SUCCESS) {
if(RegQueryValueEx(key, WINDOWS_VERSION, NULL, NULL, buffer, &buflen) == ERROR_SUCCESS) {
@@ -405,7 +405,7 @@ void winpcap_auto_start()
if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, NPF_KEY, 0, (KEY_READ | KEY_WRITE), &npfKey) == ERROR_SUCCESS) {
(void)RegSetValueEx(npfKey, NPF_START, 0, REG_DWORD, (BYTE*)&startVal, sizeof(DWORD));
-
+
RegCloseKey(npfKey);
}
@@ -768,7 +768,7 @@ void host_configure(void)
RegCloseKey(key);
- }
+ }
if(!hasRedist) {
@@ -868,10 +868,10 @@ main(int argc, char *argv[])
{
DWORD time_out = 0;
char *u3_is_device_available;
-#if 0
+#if 0
char **envptr;
char *envval;
-# endif
+# endif
u3_is_device_available = getenv("U3_IS_DEVICE_AVAILABLE");
if(u3_is_device_available && !strncmp(u3_is_device_available, "true", 4))
diff --git a/tools/checkAPIs.pl b/tools/checkAPIs.pl
index fca4fa9334..e439549897 100755
--- a/tools/checkAPIs.pl
+++ b/tools/checkAPIs.pl
@@ -73,6 +73,9 @@ my %APIs = (
'bzero',
'bcopy',
'bcmp',
+ # The MSDN page for ZeroMemory recommends SecureZeroMemory
+ # instead.
+ 'ZeroMemory',
# use ep_*, se_*, or g_* functions instead of these:
# (One thing to be aware of is that space allocated with malloc()
# may not be freeable--at least on Windows--with g_free() and
diff --git a/win32/file_dlg_win32.c b/win32/file_dlg_win32.c
index 0e191b992f..8809a840fc 100644
--- a/win32/file_dlg_win32.c
+++ b/win32/file_dlg_win32.c
@@ -184,7 +184,7 @@ win32_open_file (HWND h_wnd) {
* the open dialog window does not appear.
* Instead detect Windows version at runtime and choose size accordingly */
#if (_MSC_VER >= 1500)
- ZeroMemory(&osvi, sizeof(OSVERSIONINFO));
+ SecureZeroMemory(&osvi, sizeof(OSVERSIONINFO));
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
GetVersionEx(&osvi);
if (osvi.dwMajorVersion >= 5) {
@@ -269,7 +269,7 @@ win32_save_as_file(HWND h_wnd, action_after_save_e action_after_save, gpointer a
/* see OPENFILENAME comment in win32_open_file */
#if (_MSC_VER >= 1500)
- ZeroMemory(&osvi, sizeof(OSVERSIONINFO));
+ SecureZeroMemory(&osvi, sizeof(OSVERSIONINFO));
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
GetVersionEx(&osvi);
if (osvi.dwMajorVersion >= 5) {
@@ -415,7 +415,7 @@ win32_merge_file (HWND h_wnd) {
/* see OPENFILENAME comment in win32_open_file */
#if (_MSC_VER >= 1500)
- ZeroMemory(&osvi, sizeof(OSVERSIONINFO));
+ SecureZeroMemory(&osvi, sizeof(OSVERSIONINFO));
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
GetVersionEx(&osvi);
if (osvi.dwMajorVersion >= 5) {
@@ -538,7 +538,7 @@ win32_export_file(HWND h_wnd, export_type_e export_type) {
/* see OPENFILENAME comment in win32_open_file */
#if (_MSC_VER >= 1500)
- ZeroMemory(&osvi, sizeof(OSVERSIONINFO));
+ SecureZeroMemory(&osvi, sizeof(OSVERSIONINFO));
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
GetVersionEx(&osvi);
if (osvi.dwMajorVersion >= 5) {
@@ -662,7 +662,7 @@ win32_export_raw_file(HWND h_wnd) {
/* see OPENFILENAME comment in win32_open_file */
#if (_MSC_VER >= 1500)
- ZeroMemory(&osvi, sizeof(OSVERSIONINFO));
+ SecureZeroMemory(&osvi, sizeof(OSVERSIONINFO));
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
GetVersionEx(&osvi);
if (osvi.dwMajorVersion >= 5) {
@@ -756,7 +756,7 @@ win32_export_sslkeys_file(HWND h_wnd) {
/* see OPENFILENAME comment in win32_open_file */
#if (_MSC_VER >= 1500)
- ZeroMemory(&osvi, sizeof(OSVERSIONINFO));
+ SecureZeroMemory(&osvi, sizeof(OSVERSIONINFO));
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
GetVersionEx(&osvi);
if (osvi.dwMajorVersion >= 5) {
@@ -841,7 +841,7 @@ win32_export_color_file(HWND h_wnd, gpointer filter_list) {
/* see OPENFILENAME comment in win32_open_file */
#if (_MSC_VER >= 1500)
- ZeroMemory(&osvi, sizeof(OSVERSIONINFO));
+ SecureZeroMemory(&osvi, sizeof(OSVERSIONINFO));
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
GetVersionEx(&osvi);
if (osvi.dwMajorVersion >= 5) {
@@ -906,7 +906,7 @@ win32_import_color_file(HWND h_wnd, gpointer color_filters) {
/* see OPENFILENAME comment in win32_open_file */
#if (_MSC_VER >= 1500)
- ZeroMemory(&osvi, sizeof(OSVERSIONINFO));
+ SecureZeroMemory(&osvi, sizeof(OSVERSIONINFO));
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
GetVersionEx(&osvi);
if (osvi.dwMajorVersion >= 5) {
@@ -2109,4 +2109,3 @@ export_sslkeys_file_hook_proc(HWND ef_hwnd, UINT msg, WPARAM w_param, LPARAM l_p
* ex: set shiftwidth=4 tabstop=8 expandtab
* :indentSize=4:tabSize=8:noTabs=true:
*/
-