mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
[RSAENH] Use StringCbPrintfA instead of sprintf
Fixes GCC 8 warning: dll/win32/rsaenh/rsaenh.c:161:23: error: '%s' directive writing up to 259 bytes into a region of size 235 [-Werror=format-overflow=] #define RSAENH_REGKEY "Software\\Wine\\Crypto\\RSA\\%s" ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ dll/win32/rsaenh/rsaenh.c:161:23: note: in definition of macro 'RSAENH_REGKEY' #define RSAENH_REGKEY "Software\\Wine\\Crypto\\RSA\\%s" ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ dll/win32/rsaenh/rsaenh.c:1107:5: note: 'sprintf' output between 26 and 285 bytes into a destination of size 260 sprintf(szRSABase, RSAENH_REGKEY, pKeyContainer->szName); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This commit is contained in:
parent
6129fbaf1e
commit
089d59bc6c
1 changed files with 2 additions and 1 deletions
|
@ -43,6 +43,7 @@
|
|||
#include <objbase.h>
|
||||
#include <rpcproxy.h>
|
||||
#include <aclapi.h>
|
||||
#include <strsafe.h>
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(crypt);
|
||||
|
||||
|
@ -1104,7 +1105,7 @@ static BOOL create_container_key(KEYCONTAINER *pKeyContainer, REGSAM sam, HKEY *
|
|||
CHAR szRSABase[MAX_PATH];
|
||||
HKEY hRootKey;
|
||||
|
||||
sprintf(szRSABase, RSAENH_REGKEY, pKeyContainer->szName);
|
||||
StringCbPrintfA(szRSABase, sizeof(szRSABase), RSAENH_REGKEY, pKeyContainer->szName);
|
||||
|
||||
if (pKeyContainer->dwFlags & CRYPT_MACHINE_KEYSET)
|
||||
hRootKey = HKEY_LOCAL_MACHINE;
|
||||
|
|
Loading…
Reference in a new issue