[CONTROL]
authorKamil Hornicek <kamil.hornicek@reactos.org>
Sun, 5 Feb 2017 10:28:42 +0000 (10:28 +0000)
committerKamil Hornicek <kamil.hornicek@reactos.org>
Sun, 5 Feb 2017 10:28:42 +0000 (10:28 +0000)
- Use strsafe functions. CID 515200

svn path=/trunk/; revision=73699

reactos/base/applications/control/control.c

index 0984e98..f2480f8 100644 (file)
@@ -15,6 +15,7 @@
 #include <winuser.h>
 #include <winreg.h>
 #include <shellapi.h>
+#include <strsafe.h>
 
 #include "resource.h"
 
@@ -41,8 +42,8 @@ OpenShellFolder(LPWSTR lpFolderCLSID)
      * Open a shell folder using "explorer.exe". The passed CLSIDs
      * are all subfolders of the "Control Panel" shell folder.
      */
-    wcscpy(szParameters, L"/n,::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}");
-    wcscat(szParameters, lpFolderCLSID);
+    StringCbCopy(szParameters, sizeof(szParameters), L"/n,::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}");
+    StringCbCat(szParameters,sizeof(szParameters), lpFolderCLSID);
 
     return (INT_PTR)ShellExecuteW(NULL,
                                   L"open",