mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-03-22 06:38:37 -05:00
Coverity build fixes.
Like every other toolchain I've tried, my Coverity scanning build has its share of random objections to parts of my Windows API type- checking system. I do wonder if that bright idea was worth the hassle - but it would probably cost all the annoyance all over again to back out now...
This commit is contained in:
parent
98cbe6963b
commit
4696f4a40b
@ -19,7 +19,14 @@ int got_crypt(void)
|
|||||||
attempted = TRUE;
|
attempted = TRUE;
|
||||||
crypt = load_system32_dll("crypt32.dll");
|
crypt = load_system32_dll("crypt32.dll");
|
||||||
successful = crypt &&
|
successful = crypt &&
|
||||||
GET_WINDOWS_FUNCTION(crypt, CryptProtectMemory);
|
#ifdef COVERITY
|
||||||
|
/* The build toolchain I use with Coverity doesn't know
|
||||||
|
* about this function, so can't type-check it */
|
||||||
|
GET_WINDOWS_FUNCTION_NO_TYPECHECK(crypt, CryptProtectMemory)
|
||||||
|
#else
|
||||||
|
GET_WINDOWS_FUNCTION(crypt, CryptProtectMemory)
|
||||||
|
#endif
|
||||||
|
;
|
||||||
}
|
}
|
||||||
return successful;
|
return successful;
|
||||||
}
|
}
|
||||||
|
@ -284,10 +284,11 @@ static char *sk_handle_peer_info(Socket s)
|
|||||||
|
|
||||||
if (!kernel32_module) {
|
if (!kernel32_module) {
|
||||||
kernel32_module = load_system32_dll("kernel32.dll");
|
kernel32_module = load_system32_dll("kernel32.dll");
|
||||||
#if (defined _MSC_VER && _MSC_VER < 1900) || defined __MINGW32__
|
#if (defined _MSC_VER && _MSC_VER < 1900) || defined __MINGW32__ || defined COVERITY
|
||||||
/* For older Visual Studio, and MinGW too (at least as of
|
/* For older Visual Studio, and MinGW too (at least as of
|
||||||
* Ubuntu 16.04), this function isn't available in the header
|
* Ubuntu 16.04), this function isn't available in the header
|
||||||
* files to type-check */
|
* files to type-check. Ditto the toolchain I use for
|
||||||
|
* Coveritying the Windows code. */
|
||||||
GET_WINDOWS_FUNCTION_NO_TYPECHECK(
|
GET_WINDOWS_FUNCTION_NO_TYPECHECK(
|
||||||
kernel32_module, GetNamedPipeClientProcessId);
|
kernel32_module, GetNamedPipeClientProcessId);
|
||||||
#else
|
#else
|
||||||
|
@ -177,9 +177,11 @@ void dll_hijacking_protection(void)
|
|||||||
|
|
||||||
if (!kernel32_module) {
|
if (!kernel32_module) {
|
||||||
kernel32_module = load_system32_dll("kernel32.dll");
|
kernel32_module = load_system32_dll("kernel32.dll");
|
||||||
#if defined _MSC_VER && _MSC_VER < 1900
|
#if (defined _MSC_VER && _MSC_VER < 1900) || defined COVERITY
|
||||||
/* For older Visual Studio, this function isn't available in
|
/* For older Visual Studio, and also for the system I
|
||||||
* the header files to type-check */
|
* currently use for Coveritying the Windows code, this
|
||||||
|
* function isn't available in the header files to
|
||||||
|
* type-check */
|
||||||
GET_WINDOWS_FUNCTION_NO_TYPECHECK(
|
GET_WINDOWS_FUNCTION_NO_TYPECHECK(
|
||||||
kernel32_module, SetDefaultDllDirectories);
|
kernel32_module, SetDefaultDllDirectories);
|
||||||
#else
|
#else
|
||||||
|
@ -305,11 +305,21 @@ void sk_init(void)
|
|||||||
GET_WINDOWS_FUNCTION(winsock_module, WSAStartup);
|
GET_WINDOWS_FUNCTION(winsock_module, WSAStartup);
|
||||||
GET_WINDOWS_FUNCTION(winsock_module, WSACleanup);
|
GET_WINDOWS_FUNCTION(winsock_module, WSACleanup);
|
||||||
GET_WINDOWS_FUNCTION(winsock_module, closesocket);
|
GET_WINDOWS_FUNCTION(winsock_module, closesocket);
|
||||||
|
#ifndef COVERITY
|
||||||
GET_WINDOWS_FUNCTION(winsock_module, ntohl);
|
GET_WINDOWS_FUNCTION(winsock_module, ntohl);
|
||||||
GET_WINDOWS_FUNCTION(winsock_module, htonl);
|
GET_WINDOWS_FUNCTION(winsock_module, htonl);
|
||||||
GET_WINDOWS_FUNCTION(winsock_module, htons);
|
GET_WINDOWS_FUNCTION(winsock_module, htons);
|
||||||
GET_WINDOWS_FUNCTION(winsock_module, ntohs);
|
GET_WINDOWS_FUNCTION(winsock_module, ntohs);
|
||||||
GET_WINDOWS_FUNCTION(winsock_module, gethostname);
|
GET_WINDOWS_FUNCTION(winsock_module, gethostname);
|
||||||
|
#else
|
||||||
|
/* The toolchain I use for Windows Coverity builds doesn't know
|
||||||
|
* the type signatures of these */
|
||||||
|
GET_WINDOWS_FUNCTION_NO_TYPECHECK(winsock_module, ntohl);
|
||||||
|
GET_WINDOWS_FUNCTION_NO_TYPECHECK(winsock_module, htonl);
|
||||||
|
GET_WINDOWS_FUNCTION_NO_TYPECHECK(winsock_module, htons);
|
||||||
|
GET_WINDOWS_FUNCTION_NO_TYPECHECK(winsock_module, ntohs);
|
||||||
|
GET_WINDOWS_FUNCTION_NO_TYPECHECK(winsock_module, gethostname);
|
||||||
|
#endif
|
||||||
GET_WINDOWS_FUNCTION(winsock_module, gethostbyname);
|
GET_WINDOWS_FUNCTION(winsock_module, gethostbyname);
|
||||||
GET_WINDOWS_FUNCTION(winsock_module, getservbyname);
|
GET_WINDOWS_FUNCTION(winsock_module, getservbyname);
|
||||||
GET_WINDOWS_FUNCTION(winsock_module, inet_addr);
|
GET_WINDOWS_FUNCTION(winsock_module, inet_addr);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user