Merge pull request #12364 from akallabeth/warning-fixes

Warning fixes
This commit is contained in:
akallabeth
2026-02-25 07:52:26 +01:00
committed by GitHub
31 changed files with 161 additions and 113 deletions

View File

@@ -32,7 +32,7 @@ static inline void rdpecam_PrintWarning(wLog* log, const char* file, const char*
WINPR_FORMAT_ARG const char* fmt, ...)
{
const DWORD level = WLOG_WARN;
va_list ap;
va_list ap = { 0 };
va_start(ap, fmt);
if (WLog_IsLevelActive(log, level))

View File

@@ -1202,7 +1202,7 @@ static UINT rdpei_touch_raw_event(RdpeiClientContext* context, INT32 externalId,
INT32* contactId, UINT32 flags, UINT32 fieldFlags, ...)
{
UINT rc = 0;
va_list ap;
va_list ap = { 0 };
va_start(ap, fieldFlags);
rc = rdpei_touch_process(context, externalId, flags, x, y, contactId, fieldFlags, ap);
va_end(ap);
@@ -1345,7 +1345,7 @@ static UINT rdpei_pen_begin(RdpeiClientContext* context, INT32 externalId, UINT3
INT32 x, INT32 y, ...)
{
UINT error = 0;
va_list ap;
va_list ap = { 0 };
va_start(ap, y);
error = rdpei_pen_process(context, externalId,
@@ -1366,7 +1366,7 @@ static UINT rdpei_pen_update(RdpeiClientContext* context, INT32 externalId, UINT
INT32 x, INT32 y, ...)
{
UINT error = 0;
va_list ap;
va_list ap = { 0 };
va_start(ap, y);
error = rdpei_pen_process(context, externalId,
@@ -1386,7 +1386,7 @@ static UINT rdpei_pen_end(RdpeiClientContext* context, INT32 externalId, UINT32
INT32 y, ...)
{
UINT error = 0;
va_list ap;
va_list ap = { 0 };
va_start(ap, y);
error = rdpei_pen_process(context, externalId,
RDPINPUT_CONTACT_FLAG_UP | RDPINPUT_CONTACT_FLAG_INRANGE, fieldFlags,
@@ -1404,7 +1404,7 @@ static UINT rdpei_pen_hover_begin(RdpeiClientContext* context, INT32 externalId,
INT32 x, INT32 y, ...)
{
UINT error = 0;
va_list ap;
va_list ap = { 0 };
va_start(ap, y);
error = rdpei_pen_process(context, externalId,
@@ -1424,7 +1424,7 @@ static UINT rdpei_pen_hover_update(RdpeiClientContext* context, INT32 externalId
INT32 x, INT32 y, ...)
{
UINT error = 0;
va_list ap;
va_list ap = { 0 };
va_start(ap, y);
error = rdpei_pen_process(context, externalId,
@@ -1444,7 +1444,7 @@ static UINT rdpei_pen_hover_cancel(RdpeiClientContext* context, INT32 externalId
INT32 x, INT32 y, ...)
{
UINT error = 0;
va_list ap;
va_list ap = { 0 };
va_start(ap, y);
error = rdpei_pen_process(context, externalId,
@@ -1459,7 +1459,7 @@ static UINT rdpei_pen_raw_event(RdpeiClientContext* context, INT32 externalId, U
UINT32 fieldFlags, INT32 x, INT32 y, ...)
{
UINT error = 0;
va_list ap;
va_list ap = { 0 };
va_start(ap, y);
error = rdpei_pen_process(context, externalId, contactFlags, fieldFlags, x, y, ap);

View File

@@ -201,7 +201,7 @@ finish:
/* callback to freerdp class */
void freerdp_callback(const char* callback, const char* signature, ...)
{
va_list vl;
va_list vl = { 0 };
va_start(vl, signature);
java_callback_void(jLibFreeRDPObject, callback, signature, vl);
va_end(vl);
@@ -209,7 +209,7 @@ void freerdp_callback(const char* callback, const char* signature, ...)
jboolean freerdp_callback_bool_result(const char* callback, const char* signature, ...)
{
va_list vl;
va_list vl = { 0 };
va_start(vl, signature);
jboolean res = java_callback_bool(jLibFreeRDPObject, callback, signature, vl);
va_end(vl);
@@ -218,7 +218,7 @@ jboolean freerdp_callback_bool_result(const char* callback, const char* signatur
jint freerdp_callback_int_result(const char* callback, const char* signature, ...)
{
va_list vl;
va_list vl = { 0 };
va_start(vl, signature);
jint res = java_callback_int(jLibFreeRDPObject, callback, signature, vl);
va_end(vl);

View File

@@ -455,7 +455,7 @@ std::string SDLConnectionDialog::print(const char* fmt, va_list ap)
if (size > 0)
res.resize(WINPR_ASSERTING_INT_CAST(size_t, size));
va_list copy;
va_list copy = {};
va_copy(copy, ap);
WINPR_PRAGMA_DIAG_PUSH
WINPR_PRAGMA_DIAG_IGNORED_FORMAT_NONLITERAL

View File

@@ -439,7 +439,7 @@ std::string SDLConnectionDialog::print(const char* fmt, va_list ap)
if (size > 0)
res.resize(WINPR_ASSERTING_INT_CAST(uint32_t, size));
va_list copy;
va_list copy = {};
va_copy(copy, ap);
WINPR_PRAGMA_DIAG_PUSH
WINPR_PRAGMA_DIAG_IGNORED_FORMAT_NONLITERAL

View File

@@ -75,7 +75,7 @@ bool SdlConnectionDialogWrapper::handleEvent(const SDL_Event& event)
WINPR_ATTR_FORMAT_ARG(1, 0)
static std::string format(WINPR_FORMAT_ARG const char* fmt, va_list ap)
{
va_list ap1;
va_list ap1 = {};
va_copy(ap1, ap);
const int size = vsnprintf(nullptr, 0, fmt, ap1);
va_end(ap1);
@@ -86,7 +86,7 @@ static std::string format(WINPR_FORMAT_ARG const char* fmt, va_list ap)
std::string msg;
msg.resize(static_cast<size_t>(size) + 1);
va_list ap2;
va_list ap2 = {};
va_copy(ap2, ap);
std::ignore = vsnprintf(msg.data(), msg.size(), fmt, ap2);
va_end(ap2);
@@ -95,7 +95,7 @@ static std::string format(WINPR_FORMAT_ARG const char* fmt, va_list ap)
void SdlConnectionDialogWrapper::setTitle(const char* fmt, ...)
{
va_list ap;
va_list ap = {};
va_start(ap, fmt);
setTitle(format(fmt, ap));
va_end(ap);
@@ -108,7 +108,7 @@ void SdlConnectionDialogWrapper::setTitle(const std::string& title)
void SdlConnectionDialogWrapper::showInfo(const char* fmt, ...)
{
va_list ap;
va_list ap = {};
va_start(ap, fmt);
showInfo(format(fmt, ap));
va_end(ap);
@@ -121,7 +121,7 @@ void SdlConnectionDialogWrapper::showInfo(const std::string& info)
void SdlConnectionDialogWrapper::showWarn(const char* fmt, ...)
{
va_list ap;
va_list ap = {};
va_start(ap, fmt);
showWarn(format(fmt, ap));
va_end(ap);
@@ -134,7 +134,7 @@ void SdlConnectionDialogWrapper::showWarn(const std::string& info)
void SdlConnectionDialogWrapper::showError(const char* fmt, ...)
{
va_list ap;
va_list ap = {};
va_start(ap, fmt);
showError(format(fmt, ap));
va_end(ap);

View File

@@ -663,8 +663,8 @@ static WCHAR* wf_format_text(const WCHAR* fmt, ...)
do
{
WCHAR* tmp;
va_list ap;
WCHAR* tmp = NULL;
va_list ap = { 0 };
va_start(ap, fmt);
rc = _vsnwprintf(buffer, size, fmt, ap);
va_end(ap);

View File

@@ -748,6 +748,55 @@ static BOOL load_map_from_keysym(xfContext* xfc)
return mapped;
}
#if defined(WITH_VERBOSE_WINPR_ASSERT)
static BOOL compareKeySym(const x11_keysym_scancode_t* a, size_t counta,
const x11_keysym_scancode_t* b, size_t countb)
{
WINPR_ASSERT(a || (counta == 0));
WINPR_ASSERT(b || (countb == 0));
if (counta != countb)
return FALSE;
for (size_t x = 0; x < counta; x++)
{
const x11_keysym_scancode_t* ca = &a[x];
const x11_keysym_scancode_t* cb = &b[x];
if (keysym_cmp(ca, cb) != 0)
{
WLog_ERR(TAG, "%" PRIuz "\ta=%lx, should be %lx", x, ca->keysym, cb->keysym);
WLog_ERR(TAG, "KEYSYM_SCANCODE_TABLE is not properly sorted!");
return FALSE;
}
}
return TRUE;
}
static BOOL compareKey(const struct x11_key_scancode_t* a, size_t counta,
const struct x11_key_scancode_t* b, size_t countb)
{
WINPR_ASSERT(a || (counta == 0));
WINPR_ASSERT(b || (countb == 0));
if (counta != countb)
return FALSE;
for (size_t x = 0; x < counta; x++)
{
const struct x11_key_scancode_t* ca = &a[x];
const struct x11_key_scancode_t* cb = &b[x];
if (xkb_cmp(ca, cb) != 0)
{
WLog_ERR(TAG, "%" PRIuz "\ta=%s [%" PRIu32 "], should be %s [%" PRIu32 "]", x, a->name,
a->sc, b->name, b->sc);
WLog_ERR(TAG, "XKB_KEY_NAME_SCANCODE_TABLE is not properly sorted!");
return FALSE;
}
}
return TRUE;
}
#endif
BOOL xf_keyboard_init(xfContext* xfc)
{
rdpSettings* settings = NULL;
@@ -761,37 +810,18 @@ BOOL xf_keyboard_init(xfContext* xfc)
memcpy(copy, KEYSYM_SCANCODE_TABLE, sizeof(copy));
qsort(copy, ARRAYSIZE(copy), sizeof(x11_keysym_scancode_t), keysym_cmp);
if (memcmp(KEYSYM_SCANCODE_TABLE, copy, sizeof(KEYSYM_SCANCODE_TABLE)) != 0)
{
for (size_t x = 0; x < ARRAYSIZE(KEYSYM_SCANCODE_TABLE); x++)
{
const x11_keysym_scancode_t* a = &KEYSYM_SCANCODE_TABLE[x];
const x11_keysym_scancode_t* b = &copy[x];
if (a->keysym != b->keysym)
WLog_ERR(TAG, "%" PRIuz "\ta=%lx, should be %lx", x, a->keysym, b->keysym);
}
WLog_ERR(TAG, "KEYSYM_SCANCODE_TABLE is not properly sorted!");
if (!compareKeySym(KEYSYM_SCANCODE_TABLE, ARRAYSIZE(KEYSYM_SCANCODE_TABLE), copy,
ARRAYSIZE(copy)))
return FALSE;
}
}
{
struct x11_key_scancode_t copy[ARRAYSIZE(XKB_KEY_NAME_SCANCODE_TABLE)] = { 0 };
memcpy(copy, XKB_KEY_NAME_SCANCODE_TABLE, sizeof(copy));
qsort(copy, ARRAYSIZE(copy), sizeof(struct x11_key_scancode_t), xkb_cmp);
if (memcmp(XKB_KEY_NAME_SCANCODE_TABLE, copy, sizeof(XKB_KEY_NAME_SCANCODE_TABLE)) != 0)
{
for (size_t x = 0; x < ARRAYSIZE(XKB_KEY_NAME_SCANCODE_TABLE); x++)
{
const struct x11_key_scancode_t* a = &XKB_KEY_NAME_SCANCODE_TABLE[x];
const struct x11_key_scancode_t* b = &copy[x];
if (strcmp(a->name, b->name) != 0)
WLog_ERR(TAG, "%" PRIuz "\ta=%s [%" PRIu32 "], should be %s [%" PRIu32 "]", x,
a->name, a->sc, b->name, b->sc);
}
WLog_ERR(TAG, "XKB_KEY_NAME_SCANCODE_TABLE is not properly sorted!");
if (!compareKey(XKB_KEY_NAME_SCANCODE_TABLE, ARRAYSIZE(XKB_KEY_NAME_SCANCODE_TABLE), copy,
ARRAYSIZE(copy)))
return FALSE;
}
}
#endif

View File

@@ -90,7 +90,7 @@ static int write_result_log_expect_success(wLog* log, DWORD level, const char* f
{
if (rc != Success)
{
va_list ap;
va_list ap = { 0 };
(void)write_result_log_va(log, level, fname, fkt, line, display, name, rc, 0, ap);
}
return rc;
@@ -101,7 +101,7 @@ static int write_result_log_expect_one(wLog* log, DWORD level, const char* fname
{
if (rc != 1)
{
va_list ap;
va_list ap = { 0 };
(void)write_result_log_va(log, level, fname, fkt, line, display, name, rc, 0, ap);
}
return rc;

View File

@@ -232,7 +232,7 @@ static void xf_SetWindowTitleText(xfContext* xfc, Window window, const char* nam
void xf_SendClientEvent(xfContext* xfc, Window window, Atom atom, unsigned int numArgs, ...)
{
XEvent xevent = { 0 };
va_list argp;
va_list argp = { 0 };
va_start(argp, numArgs);
xevent.xclient.type = ClientMessage;

View File

@@ -2203,7 +2203,7 @@ BOOL freerdp_client_handle_pen(rdpClientContext* cctx, UINT32 flags, INT32 devic
#if defined(CHANNEL_RDPEI_CLIENT)
if ((flags & FREERDP_PEN_REGISTER) != 0)
{
va_list args;
va_list args = { 0 };
va_start(args, deviceid);
double pressure = va_arg(args, double);
@@ -2231,7 +2231,7 @@ BOOL freerdp_client_handle_pen(rdpClientContext* cctx, UINT32 flags, INT32 devic
UINT16 rotation = 0;
INT16 tiltX = 0;
INT16 tiltY = 0;
va_list args;
va_list args = { 0 };
va_start(args, deviceid);
x = va_arg(args, INT32);
@@ -2572,7 +2572,7 @@ char* freerdp_client_get_aad_url(rdpClientContext* cctx, freerdp_client_aad_type
WINPR_ASSERT(cctx);
char* str = NULL;
va_list ap;
va_list ap = { 0 };
va_start(ap, type);
switch (type)
{

View File

@@ -228,7 +228,7 @@ static CliprdrFuseFile* fuse_file_new(WINPR_FORMAT_ARG const char* fmt, ...)
WINPR_ASSERT(fmt);
{
va_list ap;
va_list ap = { 0 };
va_start(ap, fmt);
const int rc =
winpr_vasprintf(&file->filename_with_root, &file->filename_with_root_len, fmt, ap);

View File

@@ -153,7 +153,7 @@ static BOOL sso_mib_get_access_token(rdpContext* context, AccessTokenType tokenT
const char* scope = NULL;
const char* req_cnf = NULL;
va_list ap;
va_list ap = { 0 };
va_start(ap, count);
if (tokenType == ACCESS_TOKEN_TYPE_AAD)

View File

@@ -46,7 +46,7 @@ NSString *TSXSessionDidFailToConnectNotification = @"TSXSessionDidFailToConnect"
static BOOL addArgument(int *argc, char ***argv, const char *fmt, ...)
{
va_list ap;
va_list ap = { 0 };
char *arg = NULL;
char **tmp = realloc(*argv, (*argc + 1) * sizeof(char *));

View File

@@ -20,7 +20,10 @@
#ifndef FREERDP_METRICS_H
#define FREERDP_METRICS_H
#include <winpr/wtypes.h>
#include <freerdp/api.h>
#include <freerdp/types.h>
#ifdef __cplusplus
extern "C"

View File

@@ -108,7 +108,7 @@ static BOOL log_status_(SECURITY_STATUS status, DWORD level, const char* file, c
if (WLog_IsLevelActive(log, level))
{
char fwhat[128] = { 0 };
va_list ap;
va_list ap = { 0 };
va_start(ap, what);
(void)vsnprintf(fwhat, sizeof(fwhat) - 1, what, ap);
va_end(ap);

View File

@@ -807,7 +807,7 @@ static BOOL freerdp_common_context(rdpContext* context, AccessTokenType tokenTyp
if (!context->instance || !context->instance->GetAccessToken)
return TRUE;
va_list ap;
va_list ap = { 0 };
va_start(ap, count);
switch (tokenType)
{

View File

@@ -271,7 +271,7 @@ WINPR_ATTR_FORMAT_ARG(2, 0)
static BOOL list_append(HttpContext* context, WINPR_FORMAT_ARG const char* str, va_list ap)
{
BOOL rc = FALSE;
va_list vat;
va_list vat = { 0 };
char* Pragma = NULL;
size_t PragmaSize = 0;
@@ -1703,7 +1703,7 @@ FREERDP_LOCAL BOOL http_context_set_header(HttpContext* context, const char* key
...)
{
WINPR_ASSERT(context);
va_list ap;
va_list ap = { 0 };
va_start(ap, value);
const BOOL rc = http_context_set_header_va(context, key, value, ap);
va_end(ap);
@@ -1715,7 +1715,7 @@ BOOL http_request_set_header(HttpRequest* request, const char* key, const char*
WINPR_ASSERT(request);
char* v = NULL;
size_t vlen = 0;
va_list ap;
va_list ap = { 0 };
va_start(ap, value);
winpr_vasprintf(&v, &vlen, value, ap);
va_end(ap);

View File

@@ -15,7 +15,7 @@
static void log_start_(const char* fkt, ...)
{
(void)fprintf(stderr, "TestSettings [");
va_list ap;
va_list ap = { 0 };
va_start(ap, fkt);
(void)vfprintf(stderr, fkt, ap);
va_end(ap);
@@ -27,7 +27,7 @@ static void log_start_(const char* fkt, ...)
static BOOL log_result_(BOOL value, const char* fkt, ...)
{
(void)fprintf(stderr, "TestSettings [");
va_list ap;
va_list ap = { 0 };
va_start(ap, fkt);
(void)vfprintf(stderr, fkt, ap);
va_end(ap);

View File

@@ -408,7 +408,7 @@ BOOL freerdp_key_generate(rdpPrivateKey* key, const char* type, size_t count, ..
WLog_ERR(TAG, "Argument type=%s requires count=1, got %" PRIuz ", aborting", type, count);
return FALSE;
}
va_list ap;
va_list ap = { 0 };
va_start(ap, count);
const int key_length = va_arg(ap, int);
va_end(ap);

View File

@@ -136,7 +136,7 @@ static void dyn_log_(wLog* log, DWORD level, const pServerDynamicChannelContext*
getDirection(isBackData), channelName, drdynvc_get_packet_type(cmd),
channelId);
va_list ap;
va_list ap = { 0 };
va_start(ap, fmt);
(void)winpr_vasprintf(&msg, &msglen, fmt, ap);
va_end(ap);

View File

@@ -54,7 +54,7 @@ static const char* event_names[] = {
static bool uwac_default_error_handler(UwacDisplay* display, UwacReturnCode code, const char* msg,
...)
{
va_list args;
va_list args = { 0 };
va_start(args, msg);
(void)vfprintf(stderr, "%s", args);
va_end(args);

View File

@@ -594,7 +594,7 @@ WINPR_PRAGMA_DIAG_POP
#if defined(__GNUC__) || defined(__clang__)
#define WINPR_ATTR_FORMAT_ARG(pos, args) __attribute__((__format__(__printf__, pos, args)))
#define WINPR_FORMAT_ARG /**/
#else
#elif defined(_MSC_VER)
#define WINPR_ATTR_FORMAT_ARG(pos, args)
#define WINPR_FORMAT_ARG _Printf_format_string_
#endif

View File

@@ -273,7 +273,11 @@ extern "C"
if (WLog_IsLevelActive(log_cached_ptr, log_level))
{
va_list ap;
#if defined(__cplusplus)
va_list ap = {};
#else
va_list ap = { 0 };
#endif
va_start(ap, fmt);
WLog_PrintTextMessageVA(log_cached_ptr, log_level, line, file, fkt, fmt, ap);
va_end(ap);

View File

@@ -1258,7 +1258,7 @@ char* winpr_GetConfigFilePath(BOOL system, const char* filename)
char* winpr_GetConfigFilePathV(BOOL system, const char* filename, ...)
{
va_list ap;
va_list ap = { 0 };
va_start(ap, filename);
char* str = winpr_GetConfigFilePathVA(system, filename, ap);
va_end(ap);

View File

@@ -401,7 +401,7 @@ char* GetKnownSubPath(eKnownPathTypes id, const char* path)
char* GetKnownSubPathV(eKnownPathTypes id, const char* path, ...)
{
va_list ap;
va_list ap = { 0 };
va_start(ap, path);
char* str = GetKnownSubPathVA(id, path, ap);
@@ -455,7 +455,7 @@ char* GetEnvironmentSubPath(char* name, const char* path)
char* GetEnvironmentSubPathV(char* name, const char* path, ...)
{
va_list ap;
va_list ap = { 0 };
va_start(ap, path);
char* str = GetEnvironmentSubPathVA(name, path, ap);
va_end(ap);
@@ -483,7 +483,7 @@ char* GetCombinedPath(const char* basePath, const char* subPathFmt)
char* GetCombinedPathV(const char* basePath, const char* subPathFmt, ...)
{
va_list ap;
va_list ap = { 0 };
va_start(ap, subPathFmt);
char* str = GetCombinedPathVA(basePath, subPathFmt, ap);

View File

@@ -60,10 +60,6 @@
#include "../sspi.h"
#include "../../log.h"
#define TAG WINPR_TAG("sspi.Kerberos")
#define KRB_TGT_REQ 16
#define KRB_TGT_REP 17
const SecPkgInfoA KERBEROS_SecPkgInfoA = {
0x000F3BBF, /* fCapabilities */
@@ -87,6 +83,10 @@ const SecPkgInfoW KERBEROS_SecPkgInfoW = {
};
#ifdef WITH_KRB5
#define TAG WINPR_TAG("sspi.Kerberos")
#define KRB_TGT_REQ 16
#define KRB_TGT_REP 17
enum KERBEROS_STATE
{
@@ -298,9 +298,10 @@ fail:
#endif /* WITH_KRB5 */
static SECURITY_STATUS SEC_ENTRY kerberos_AcquireCredentialsHandleA(
SEC_CHAR* pszPrincipal, WINPR_ATTR_UNUSED SEC_CHAR* pszPackage, ULONG fCredentialUse,
WINPR_ATTR_UNUSED void* pvLogonID, void* pAuthData, WINPR_ATTR_UNUSED SEC_GET_KEY_FN pGetKeyFn,
WINPR_ATTR_UNUSED void* pvGetKeyArgument, PCredHandle phCredential,
WINPR_ATTR_UNUSED SEC_CHAR* pszPrincipal, WINPR_ATTR_UNUSED SEC_CHAR* pszPackage,
WINPR_ATTR_UNUSED ULONG fCredentialUse, WINPR_ATTR_UNUSED void* pvLogonID,
WINPR_ATTR_UNUSED void* pAuthData, WINPR_ATTR_UNUSED SEC_GET_KEY_FN pGetKeyFn,
WINPR_ATTR_UNUSED void* pvGetKeyArgument, WINPR_ATTR_UNUSED PCredHandle phCredential,
WINPR_ATTR_UNUSED PTimeStamp ptsExpiry)
{
#ifdef WITH_KRB5
@@ -578,7 +579,8 @@ static void credentials_unref(KRB_CREDENTIALS* credentials)
}
#endif
static SECURITY_STATUS SEC_ENTRY kerberos_FreeCredentialsHandle(PCredHandle phCredential)
static SECURITY_STATUS
SEC_ENTRY kerberos_FreeCredentialsHandle(WINPR_ATTR_UNUSED PCredHandle phCredential)
{
#ifdef WITH_KRB5
KRB_CREDENTIALS* credentials = sspi_SecureHandleGetLowerPointer(phCredential);
@@ -595,7 +597,8 @@ static SECURITY_STATUS SEC_ENTRY kerberos_FreeCredentialsHandle(PCredHandle phCr
}
static SECURITY_STATUS SEC_ENTRY kerberos_QueryCredentialsAttributesW(
WINPR_ATTR_UNUSED PCredHandle phCredential, ULONG ulAttribute, WINPR_ATTR_UNUSED void* pBuffer)
WINPR_ATTR_UNUSED PCredHandle phCredential, WINPR_ATTR_UNUSED ULONG ulAttribute,
WINPR_ATTR_UNUSED void* pBuffer)
{
#ifdef WITH_KRB5
switch (ulAttribute)
@@ -909,8 +912,6 @@ static BOOL kerberos_rd_tgt_token(const sspi_gss_data* token, char** target, krb
return FALSE;
}
#endif /* WITH_KRB5 */
static BOOL kerberos_hash_channel_bindings(WINPR_DIGEST_CTX* md5, SEC_CHANNEL_BINDINGS* bindings)
{
BYTE buf[4];
@@ -953,10 +954,14 @@ static BOOL kerberos_hash_channel_bindings(WINPR_DIGEST_CTX* md5, SEC_CHANNEL_BI
return TRUE;
}
#endif /* WITH_KRB5 */
static SECURITY_STATUS SEC_ENTRY kerberos_InitializeSecurityContextA(
PCredHandle phCredential, PCtxtHandle phContext, SEC_CHAR* pszTargetName, ULONG fContextReq,
WINPR_ATTR_UNUSED ULONG Reserved1, WINPR_ATTR_UNUSED ULONG TargetDataRep, PSecBufferDesc pInput,
WINPR_ATTR_UNUSED ULONG Reserved2, PCtxtHandle phNewContext, PSecBufferDesc pOutput,
WINPR_ATTR_UNUSED PCredHandle phCredential, WINPR_ATTR_UNUSED PCtxtHandle phContext,
WINPR_ATTR_UNUSED SEC_CHAR* pszTargetName, WINPR_ATTR_UNUSED ULONG fContextReq,
WINPR_ATTR_UNUSED ULONG Reserved1, WINPR_ATTR_UNUSED ULONG TargetDataRep,
WINPR_ATTR_UNUSED PSecBufferDesc pInput, WINPR_ATTR_UNUSED ULONG Reserved2,
WINPR_ATTR_UNUSED PCtxtHandle phNewContext, WINPR_ATTR_UNUSED PSecBufferDesc pOutput,
WINPR_ATTR_UNUSED ULONG* pfContextAttr, WINPR_ATTR_UNUSED PTimeStamp ptsExpiry)
{
#ifdef WITH_KRB5
@@ -1416,9 +1421,10 @@ out:
#endif
static SECURITY_STATUS SEC_ENTRY kerberos_AcceptSecurityContext(
PCredHandle phCredential, PCtxtHandle phContext, PSecBufferDesc pInput,
WINPR_ATTR_UNUSED ULONG fContextReq, WINPR_ATTR_UNUSED ULONG TargetDataRep,
PCtxtHandle phNewContext, PSecBufferDesc pOutput, ULONG* pfContextAttr,
WINPR_ATTR_UNUSED PCredHandle phCredential, WINPR_ATTR_UNUSED PCtxtHandle phContext,
WINPR_ATTR_UNUSED PSecBufferDesc pInput, WINPR_ATTR_UNUSED ULONG fContextReq,
WINPR_ATTR_UNUSED ULONG TargetDataRep, WINPR_ATTR_UNUSED PCtxtHandle phNewContext,
WINPR_ATTR_UNUSED PSecBufferDesc pOutput, WINPR_ATTR_UNUSED ULONG* pfContextAttr,
WINPR_ATTR_UNUSED PTimeStamp ptsExpity)
{
#ifdef WITH_KRB5
@@ -1624,7 +1630,8 @@ static BOOL copy_krb5_data(krb5_data* data, PUCHAR* ptr, ULONG* psize)
}
#endif
static SECURITY_STATUS SEC_ENTRY kerberos_DeleteSecurityContext(PCtxtHandle phContext)
static SECURITY_STATUS
SEC_ENTRY kerberos_DeleteSecurityContext(WINPR_ATTR_UNUSED PCtxtHandle phContext)
{
#ifdef WITH_KRB5
KRB_CONTEXT* context = get_context(phContext);
@@ -1887,8 +1894,9 @@ out:
#endif /* WITH_KRB5 */
static SECURITY_STATUS SEC_ENTRY kerberos_QueryContextAttributesA(PCtxtHandle phContext,
ULONG ulAttribute, void* pBuffer)
static SECURITY_STATUS
SEC_ENTRY kerberos_QueryContextAttributesA(PCtxtHandle phContext,
WINPR_ATTR_UNUSED ULONG ulAttribute, void* pBuffer)
{
if (!phContext)
return SEC_E_INVALID_HANDLE;
@@ -1949,10 +1957,10 @@ static SECURITY_STATUS SEC_ENTRY kerberos_SetContextAttributesA(
return SEC_E_UNSUPPORTED_FUNCTION;
}
static SECURITY_STATUS SEC_ENTRY kerberos_SetCredentialsAttributesX(PCredHandle phCredential,
ULONG ulAttribute,
void* pBuffer, ULONG cbBuffer,
WINPR_ATTR_UNUSED BOOL unicode)
static SECURITY_STATUS SEC_ENTRY kerberos_SetCredentialsAttributesX(
WINPR_ATTR_UNUSED PCredHandle phCredential, WINPR_ATTR_UNUSED ULONG ulAttribute,
WINPR_ATTR_UNUSED void* pBuffer, WINPR_ATTR_UNUSED ULONG cbBuffer,
WINPR_ATTR_UNUSED BOOL unicode)
{
#ifdef WITH_KRB5
KRB_CREDENTIALS* credentials = NULL;
@@ -2027,9 +2035,10 @@ static SECURITY_STATUS SEC_ENTRY kerberos_SetCredentialsAttributesA(PCredHandle
return kerberos_SetCredentialsAttributesX(phCredential, ulAttribute, pBuffer, cbBuffer, FALSE);
}
static SECURITY_STATUS SEC_ENTRY kerberos_EncryptMessage(PCtxtHandle phContext, ULONG fQOP,
PSecBufferDesc pMessage,
ULONG MessageSeqNo)
static SECURITY_STATUS SEC_ENTRY kerberos_EncryptMessage(WINPR_ATTR_UNUSED PCtxtHandle phContext,
WINPR_ATTR_UNUSED ULONG fQOP,
WINPR_ATTR_UNUSED PSecBufferDesc pMessage,
WINPR_ATTR_UNUSED ULONG MessageSeqNo)
{
#ifdef WITH_KRB5
KRB_CONTEXT* context = get_context(phContext);
@@ -2117,9 +2126,10 @@ static SECURITY_STATUS SEC_ENTRY kerberos_EncryptMessage(PCtxtHandle phContext,
#endif
}
static SECURITY_STATUS SEC_ENTRY kerberos_DecryptMessage(PCtxtHandle phContext,
PSecBufferDesc pMessage,
ULONG MessageSeqNo, ULONG* pfQOP)
static SECURITY_STATUS SEC_ENTRY kerberos_DecryptMessage(WINPR_ATTR_UNUSED PCtxtHandle phContext,
WINPR_ATTR_UNUSED PSecBufferDesc pMessage,
WINPR_ATTR_UNUSED ULONG MessageSeqNo,
WINPR_ATTR_UNUSED ULONG* pfQOP)
{
#ifdef WITH_KRB5
KRB_CONTEXT* context = get_context(phContext);
@@ -2223,9 +2233,10 @@ static SECURITY_STATUS SEC_ENTRY kerberos_DecryptMessage(PCtxtHandle phContext,
#endif
}
static SECURITY_STATUS SEC_ENTRY kerberos_MakeSignature(PCtxtHandle phContext,
static SECURITY_STATUS SEC_ENTRY kerberos_MakeSignature(WINPR_ATTR_UNUSED PCtxtHandle phContext,
WINPR_ATTR_UNUSED ULONG fQOP,
PSecBufferDesc pMessage, ULONG MessageSeqNo)
WINPR_ATTR_UNUSED PSecBufferDesc pMessage,
WINPR_ATTR_UNUSED ULONG MessageSeqNo)
{
#ifdef WITH_KRB5
KRB_CONTEXT* context = get_context(phContext);
@@ -2294,9 +2305,9 @@ static SECURITY_STATUS SEC_ENTRY kerberos_MakeSignature(PCtxtHandle phContext,
#endif
}
static SECURITY_STATUS SEC_ENTRY kerberos_VerifySignature(PCtxtHandle phContext,
PSecBufferDesc pMessage,
ULONG MessageSeqNo,
static SECURITY_STATUS SEC_ENTRY kerberos_VerifySignature(WINPR_ATTR_UNUSED PCtxtHandle phContext,
WINPR_ATTR_UNUSED PSecBufferDesc pMessage,
WINPR_ATTR_UNUSED ULONG MessageSeqNo,
WINPR_ATTR_UNUSED ULONG* pfQOP)
{
#ifdef WITH_KRB5

View File

@@ -546,7 +546,7 @@ BOOL ArrayList_ForEach(wArrayList* arrayList, ArrayList_ForEachFkt fkt, ...)
BOOL ArrayList_ForEachAP(wArrayList* arrayList, ArrayList_ForEachFkt fkt, va_list ap)
{
BOOL rc = FALSE;
va_list cap;
va_list cap = { 0 };
WINPR_ASSERT(arrayList);
WINPR_ASSERT(fkt);

View File

@@ -312,7 +312,7 @@ BOOL Stream_CheckAndLogRequiredCapacityEx(const char* tag, DWORD level, wStream*
if (actual < nmemb)
{
va_list args;
va_list args = { 0 };
va_start(args, fmt);
Stream_CheckAndLogRequiredCapacityExVa(tag, level, s, nmemb, size, fmt, args);
@@ -370,7 +370,7 @@ BOOL Stream_CheckAndLogRequiredCapacityWLogEx(wLog* log, DWORD level, wStream* s
if (actual < nmemb)
{
va_list args;
va_list args = { 0 };
va_start(args, fmt);
Stream_CheckAndLogRequiredCapacityWLogExVa(log, level, s, nmemb, size, fmt, args);
@@ -390,7 +390,7 @@ BOOL Stream_CheckAndLogRequiredLengthEx(const char* tag, DWORD level, wStream* s
if (actual < nmemb)
{
va_list args;
va_list args = { 0 };
va_start(args, fmt);
Stream_CheckAndLogRequiredLengthExVa(tag, level, s, nmemb, size, fmt, args);
@@ -421,7 +421,7 @@ BOOL Stream_CheckAndLogRequiredLengthWLogEx(wLog* log, DWORD level, wStream* s,
if (actual < nmemb)
{
va_list args;
va_list args = { 0 };
va_start(args, fmt);
Stream_CheckAndLogRequiredLengthWLogExVa(log, level, s, nmemb, size, fmt, args);

View File

@@ -91,7 +91,7 @@ WINPR_ATTR_FORMAT_ARG(3, 4)
static void WLog_PrintMessagePrefix(char* prefix, size_t prefixlen,
WINPR_FORMAT_ARG const char* format, ...)
{
va_list args;
va_list args = { 0 };
va_start(args, format);
WLog_PrintMessagePrefixVA(prefix, prefixlen, format, args);
va_end(args);

View File

@@ -429,7 +429,7 @@ BOOL WLog_PrintMessage(wLog* log, DWORD type, DWORD level, size_t line, const ch
const char* function, ...)
{
BOOL status = 0;
va_list args;
va_list args = { 0 };
va_start(args, function);
status = WLog_PrintMessageVA(log, type, level, line, file, function, args);
va_end(args);
@@ -440,7 +440,7 @@ BOOL WLog_PrintTextMessage(wLog* log, DWORD level, size_t line, const char* file
const char* function, const char* fmt, ...)
{
BOOL status = 0;
va_list args;
va_list args = { 0 };
va_start(args, fmt);
status = WLog_PrintTextMessageVA(log, level, line, file, function, fmt, args);
va_end(args);