aboutsummaryrefslogtreecommitdiffstats
path: root/epan/guid-utils.c
diff options
context:
space:
mode:
authorJeff Morriss <jeff.morriss.ws@gmail.com>2016-04-11 10:48:18 -0400
committerAnders Broman <a.broman58@gmail.com>2016-04-12 04:11:21 +0000
commitf9b688226a71c1ced36ad0b70bb4796d1a5c12b3 (patch)
treebe5ff73ca98d8b9a5075c0da153eaf22b4ce0809 /epan/guid-utils.c
parentb7897ddecc673b6aad171564a38911e81fe29f39 (diff)
Don't use _snwprintf (use StringCchPrintf instead).
The MS docs say that StringCchPrintf() is safer. Change-Id: Id3669ff75f2acb2218a8ef74cf0562e4ac3abb1e Reviewed-on: https://code.wireshark.org/review/14880 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/guid-utils.c')
-rw-r--r--epan/guid-utils.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/epan/guid-utils.c b/epan/guid-utils.c
index 8bb95b98b5..1806855f43 100644
--- a/epan/guid-utils.c
+++ b/epan/guid-utils.c
@@ -34,6 +34,7 @@
#ifdef _WIN32
#include <tchar.h>
#include <windows.h>
+#include <strsafe.h>
#endif
static wmem_tree_t *guid_to_name_tree = NULL;
@@ -42,7 +43,7 @@ static wmem_tree_t *guid_to_name_tree = NULL;
#ifdef _WIN32
/* try to resolve an DCE/RPC interface name to its name using the Windows registry entries */
/* XXX - might be better to fill all interfaces into our database at startup instead of searching each time */
-int
+static int
ResolveWin32UUID(e_guid_t if_id, char *uuid_name, int uuid_name_max_len)
{
TCHAR *reg_uuid_name;
@@ -57,7 +58,7 @@ ResolveWin32UUID(e_guid_t if_id, char *uuid_name, int uuid_name_max_len)
return 0;
}
reg_uuid_name[0] = '\0';
- _snwprintf(reg_uuid_str, MAX_PATH, _T("SOFTWARE\\Classes\\Interface\\{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}"),
+ StringCchPrintf(reg_uuid_str, MAX_PATH, _T("SOFTWARE\\Classes\\Interface\\{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}"),
if_id.data1, if_id.data2, if_id.data3,
if_id.data4[0], if_id.data4[1],
if_id.data4[2], if_id.data4[3],