From 26003e59cc4e37c49bd44f5a062403da178d8acc Mon Sep 17 00:00:00 2001 From: akallabeth Date: Tue, 17 Sep 2024 16:56:03 +0200 Subject: [PATCH] [va_list] initialize with ={0}; --- channels/location/client/location_main.c | 2 +- channels/rdpdr/client/rdpdr_main.c | 2 +- channels/urbdrc/client/libusb/libusb_udevice.c | 2 +- client/SDL/SDL2/dialogs/sdl_connection_dialog.cpp | 8 ++++---- client/SDL/SDL2/dialogs/sdl_dialogs.cpp | 10 +++++----- client/SDL/SDL2/dialogs/sdl_selectlist.cpp | 2 +- client/SDL/SDL2/sdl_freerdp.cpp | 6 +++--- client/SDL/SDL2/sdl_utils.cpp | 4 ++-- client/SDL/SDL3/dialogs/sdl_connection_dialog.cpp | 8 ++++---- client/SDL/SDL3/dialogs/sdl_dialogs.cpp | 10 +++++----- client/SDL/SDL3/dialogs/sdl_selectlist.cpp | 2 +- client/SDL/SDL3/sdl_freerdp.cpp | 6 +++--- client/SDL/SDL3/sdl_utils.cpp | 4 ++-- client/SDL/common/aad/sdl_webview.cpp | 2 +- client/X11/xf_utils.c | 2 +- client/common/client.c | 2 +- client/common/client_cliprdr_file.c | 2 +- client/common/file.c | 2 +- client/common/test/TestClientRdpFile.c | 2 +- libfreerdp/codec/dsp_fdk_aac.c | 2 +- libfreerdp/core/aad.c | 2 +- libfreerdp/core/freerdp.c | 2 +- libfreerdp/core/gateway/http.c | 6 +++--- libfreerdp/core/gateway/tsg.c | 2 +- libfreerdp/core/test/TestConnect.c | 2 +- libfreerdp/core/timezone.c | 2 +- winpr/libwinpr/comm/comm.c | 2 +- winpr/libwinpr/crt/string.c | 4 ++-- winpr/libwinpr/timezone/timezone.c | 2 +- winpr/libwinpr/utils/collections/ArrayList.c | 2 +- winpr/libwinpr/utils/collections/PubSub.c | 4 ++-- 31 files changed, 55 insertions(+), 55 deletions(-) diff --git a/channels/location/client/location_main.c b/channels/location/client/location_main.c index e0b3854f5..ec822c326 100644 --- a/channels/location/client/location_main.c +++ b/channels/location/client/location_main.c @@ -343,7 +343,7 @@ static UINT location_send(LocationClientContext* context, LOCATION_PDUTYPE type, WINPR_ASSERT(callback); UINT32 res = ERROR_INTERNAL_ERROR; - va_list ap; + va_list ap = { 0 }; va_start(ap, count); switch (type) { diff --git a/channels/rdpdr/client/rdpdr_main.c b/channels/rdpdr/client/rdpdr_main.c index 6203e33a0..0263d415e 100644 --- a/channels/rdpdr/client/rdpdr_main.c +++ b/channels/rdpdr/client/rdpdr_main.c @@ -1646,7 +1646,7 @@ static const char* state_str(size_t count, va_list ap, char* buffer, size_t size static BOOL rdpdr_state_check(rdpdrPlugin* rdpdr, UINT16 packetid, enum RDPDR_CHANNEL_STATE next, size_t count, ...) { - va_list ap; + va_list ap = { 0 }; WINPR_ASSERT(rdpdr); va_start(ap, count); diff --git a/channels/urbdrc/client/libusb/libusb_udevice.c b/channels/urbdrc/client/libusb/libusb_udevice.c index 5dfb43e90..f587c66c3 100644 --- a/channels/urbdrc/client/libusb/libusb_udevice.c +++ b/channels/urbdrc/client/libusb/libusb_udevice.c @@ -139,7 +139,7 @@ static BOOL log_libusb_result_(wLog* log, DWORD lvl, WINPR_FORMAT_ARG const char if (error < 0) { char buffer[8192] = { 0 }; - va_list ap; + va_list ap = { 0 }; va_start(ap, error); (void)vsnprintf(buffer, sizeof(buffer), fmt, ap); va_end(ap); diff --git a/client/SDL/SDL2/dialogs/sdl_connection_dialog.cpp b/client/SDL/SDL2/dialogs/sdl_connection_dialog.cpp index c4c18642d..bb676c4d7 100644 --- a/client/SDL/SDL2/dialogs/sdl_connection_dialog.cpp +++ b/client/SDL/SDL2/dialogs/sdl_connection_dialog.cpp @@ -58,7 +58,7 @@ bool SDLConnectionDialog::visible() const bool SDLConnectionDialog::setTitle(const char* fmt, ...) { std::lock_guard lock(_mux); - va_list ap; + va_list ap = {}; va_start(ap, fmt); _title = print(fmt, ap); va_end(ap); @@ -68,7 +68,7 @@ bool SDLConnectionDialog::setTitle(const char* fmt, ...) bool SDLConnectionDialog::showInfo(const char* fmt, ...) { - va_list ap; + va_list ap = {}; va_start(ap, fmt); auto rc = show(MSG_INFO, fmt, ap); va_end(ap); @@ -77,7 +77,7 @@ bool SDLConnectionDialog::showInfo(const char* fmt, ...) bool SDLConnectionDialog::showWarn(const char* fmt, ...) { - va_list ap; + va_list ap = {}; va_start(ap, fmt); auto rc = show(MSG_WARN, fmt, ap); va_end(ap); @@ -86,7 +86,7 @@ bool SDLConnectionDialog::showWarn(const char* fmt, ...) bool SDLConnectionDialog::showError(const char* fmt, ...) { - va_list ap; + va_list ap = {}; va_start(ap, fmt); auto rc = show(MSG_ERROR, fmt, ap); va_end(ap); diff --git a/client/SDL/SDL2/dialogs/sdl_dialogs.cpp b/client/SDL/SDL2/dialogs/sdl_dialogs.cpp index 54dfd4e13..eea01e354 100644 --- a/client/SDL/SDL2/dialogs/sdl_dialogs.cpp +++ b/client/SDL/SDL2/dialogs/sdl_dialogs.cpp @@ -53,7 +53,7 @@ static const char* type_str_for_flags(UINT32 flags) static BOOL sdl_wait_for_result(rdpContext* context, Uint32 type, SDL_Event* result) { - const SDL_Event empty = { 0 }; + const SDL_Event empty = {}; WINPR_ASSERT(context); WINPR_ASSERT(result); @@ -72,7 +72,7 @@ static BOOL sdl_wait_for_result(rdpContext* context, Uint32 type, SDL_Event* res static int sdl_show_dialog(rdpContext* context, const char* title, const char* message, Sint32 flags) { - SDL_Event event = { 0 }; + SDL_Event event = {}; if (!sdl_push_user_event(SDL_USEREVENT_SHOW_DIALOG, title, message, flags)) return 0; @@ -86,7 +86,7 @@ static int sdl_show_dialog(rdpContext* context, const char* title, const char* m BOOL sdl_authenticate_ex(freerdp* instance, char** username, char** password, char** domain, rdp_auth_reason reason) { - SDL_Event event = { 0 }; + SDL_Event event = {}; BOOL res = FALSE; SDLConnectionDialogHider hider(instance); @@ -185,7 +185,7 @@ BOOL sdl_choose_smartcard(freerdp* instance, SmartcardCertInfo** cert_list, DWOR list.push_back(m.c_str()); } - SDL_Event event = { 0 }; + SDL_Event event = {}; const char* title = "Select a logon smartcard certificate"; if (gateway) title = "Select a gateway logon smartcard certificate"; @@ -317,7 +317,7 @@ static DWORD sdl_show_ceritifcate_dialog(rdpContext* context, const char* title, if (!sdl_push_user_event(SDL_USEREVENT_CERT_DIALOG, title, message)) return 0; - SDL_Event event = { 0 }; + SDL_Event event = {}; if (!sdl_wait_for_result(context, SDL_USEREVENT_CERT_RESULT, &event)) return 0; return static_cast(event.user.code); diff --git a/client/SDL/SDL2/dialogs/sdl_selectlist.cpp b/client/SDL/SDL2/dialogs/sdl_selectlist.cpp index 200543113..0263694a1 100644 --- a/client/SDL/SDL2/dialogs/sdl_selectlist.cpp +++ b/client/SDL/SDL2/dialogs/sdl_selectlist.cpp @@ -63,7 +63,7 @@ int SdlSelectList::run() if (!_buttons.update(_renderer)) throw; - SDL_Event event = { 0 }; + SDL_Event event = {}; SDL_WaitEvent(&event); switch (event.type) { diff --git a/client/SDL/SDL2/sdl_freerdp.cpp b/client/SDL/SDL2/sdl_freerdp.cpp index 3568d71bd..3b2373c87 100644 --- a/client/SDL/SDL2/sdl_freerdp.cpp +++ b/client/SDL/SDL2/sdl_freerdp.cpp @@ -665,7 +665,7 @@ static const char* sdl_window_get_title(rdpSettings* settings) addPort = (port != 3389); - char buffer[MAX_PATH + 64] = { 0 }; + char buffer[MAX_PATH + 64] = {}; if (!addPort) (void)sprintf_s(buffer, sizeof(buffer), "%s %s", prefix, name); @@ -837,7 +837,7 @@ static int sdl_run(SdlContext* sdl) while (!shall_abort(sdl)) { - SDL_Event windowEvent = { 0 }; + SDL_Event windowEvent = {}; while (!shall_abort(sdl) && SDL_WaitEventTimeout(nullptr, 1000)) { /* Only poll standard SDL events and SDL_USEREVENTS meant to create dialogs. @@ -1413,7 +1413,7 @@ static DWORD WINAPI sdl_client_thread_proc(SdlContext* sdl) static BOOL sdl_client_global_init() { #if defined(_WIN32) - WSADATA wsaData = { 0 }; + WSADATA wsaData = {}; const DWORD wVersionRequested = MAKEWORD(1, 1); const int rc = WSAStartup(wVersionRequested, &wsaData); if (rc != 0) diff --git a/client/SDL/SDL2/sdl_utils.cpp b/client/SDL/SDL2/sdl_utils.cpp index b7729f1fe..7fdd48065 100644 --- a/client/SDL/SDL2/sdl_utils.cpp +++ b/client/SDL/SDL2/sdl_utils.cpp @@ -152,7 +152,7 @@ BOOL sdl_push_user_event(Uint32 type, ...) SDL_Event ev = {}; SDL_UserEvent* event = &ev.user; - va_list ap; + va_list ap = {}; va_start(ap, type); event->type = type; switch (type) @@ -285,7 +285,7 @@ HANDLE WinPREvent::handle() const bool sdl_push_quit() { - SDL_Event ev = { 0 }; + SDL_Event ev = {}; ev.type = SDL_QUIT; SDL_PushEvent(&ev); return true; diff --git a/client/SDL/SDL3/dialogs/sdl_connection_dialog.cpp b/client/SDL/SDL3/dialogs/sdl_connection_dialog.cpp index 45b800f13..28a30f9d8 100644 --- a/client/SDL/SDL3/dialogs/sdl_connection_dialog.cpp +++ b/client/SDL/SDL3/dialogs/sdl_connection_dialog.cpp @@ -58,7 +58,7 @@ bool SDLConnectionDialog::visible() const bool SDLConnectionDialog::setTitle(const char* fmt, ...) { std::lock_guard lock(_mux); - va_list ap; + va_list ap = {}; va_start(ap, fmt); _title = print(fmt, ap); va_end(ap); @@ -68,7 +68,7 @@ bool SDLConnectionDialog::setTitle(const char* fmt, ...) bool SDLConnectionDialog::showInfo(const char* fmt, ...) { - va_list ap; + va_list ap = {}; va_start(ap, fmt); auto rc = show(MSG_INFO, fmt, ap); va_end(ap); @@ -77,7 +77,7 @@ bool SDLConnectionDialog::showInfo(const char* fmt, ...) bool SDLConnectionDialog::showWarn(const char* fmt, ...) { - va_list ap; + va_list ap = {}; va_start(ap, fmt); auto rc = show(MSG_WARN, fmt, ap); va_end(ap); @@ -86,7 +86,7 @@ bool SDLConnectionDialog::showWarn(const char* fmt, ...) bool SDLConnectionDialog::showError(const char* fmt, ...) { - va_list ap; + va_list ap = {}; va_start(ap, fmt); auto rc = show(MSG_ERROR, fmt, ap); va_end(ap); diff --git a/client/SDL/SDL3/dialogs/sdl_dialogs.cpp b/client/SDL/SDL3/dialogs/sdl_dialogs.cpp index af6c7e9b2..817efc043 100644 --- a/client/SDL/SDL3/dialogs/sdl_dialogs.cpp +++ b/client/SDL/SDL3/dialogs/sdl_dialogs.cpp @@ -53,7 +53,7 @@ static const char* type_str_for_flags(UINT32 flags) static BOOL sdl_wait_for_result(rdpContext* context, Uint32 type, SDL_Event* result) { - const SDL_Event empty = { 0 }; + const SDL_Event empty = {}; WINPR_ASSERT(context); WINPR_ASSERT(result); @@ -72,7 +72,7 @@ static BOOL sdl_wait_for_result(rdpContext* context, Uint32 type, SDL_Event* res static int sdl_show_dialog(rdpContext* context, const char* title, const char* message, Sint32 flags) { - SDL_Event event = { 0 }; + SDL_Event event = {}; if (!sdl_push_user_event(SDL_EVENT_USER_SHOW_DIALOG, title, message, flags)) return 0; @@ -86,7 +86,7 @@ static int sdl_show_dialog(rdpContext* context, const char* title, const char* m BOOL sdl_authenticate_ex(freerdp* instance, char** username, char** password, char** domain, rdp_auth_reason reason) { - SDL_Event event = { 0 }; + SDL_Event event = {}; BOOL res = FALSE; SDLConnectionDialogHider hider(instance); @@ -185,7 +185,7 @@ BOOL sdl_choose_smartcard(freerdp* instance, SmartcardCertInfo** cert_list, DWOR list.push_back(m.c_str()); } - SDL_Event event = { 0 }; + SDL_Event event = {}; const char* title = "Select a logon smartcard certificate"; if (gateway) title = "Select a gateway logon smartcard certificate"; @@ -315,7 +315,7 @@ static DWORD sdl_show_ceritifcate_dialog(rdpContext* context, const char* title, if (!sdl_push_user_event(SDL_EVENT_USER_CERT_DIALOG, title, message)) return 0; - SDL_Event event = { 0 }; + SDL_Event event = {}; if (!sdl_wait_for_result(context, SDL_EVENT_USER_CERT_RESULT, &event)) return 0; return static_cast(event.user.code); diff --git a/client/SDL/SDL3/dialogs/sdl_selectlist.cpp b/client/SDL/SDL3/dialogs/sdl_selectlist.cpp index 9b84fb22f..1fb0291b2 100644 --- a/client/SDL/SDL3/dialogs/sdl_selectlist.cpp +++ b/client/SDL/SDL3/dialogs/sdl_selectlist.cpp @@ -62,7 +62,7 @@ int SdlSelectList::run() if (!_buttons.update(_renderer)) throw; - SDL_Event event = { 0 }; + SDL_Event event = {}; SDL_WaitEvent(&event); switch (event.type) { diff --git a/client/SDL/SDL3/sdl_freerdp.cpp b/client/SDL/SDL3/sdl_freerdp.cpp index 76611518c..6c5603bdd 100644 --- a/client/SDL/SDL3/sdl_freerdp.cpp +++ b/client/SDL/SDL3/sdl_freerdp.cpp @@ -663,7 +663,7 @@ static const char* sdl_window_get_title(rdpSettings* settings) addPort = (port != 3389); - char buffer[MAX_PATH + 64] = { 0 }; + char buffer[MAX_PATH + 64] = {}; if (!addPort) sprintf_s(buffer, sizeof(buffer), "%s %s", prefix, name); @@ -828,7 +828,7 @@ static int sdl_run(SdlContext* sdl) while (!shall_abort(sdl)) { - SDL_Event windowEvent = { 0 }; + SDL_Event windowEvent = {}; while (!shall_abort(sdl) && SDL_WaitEventTimeout(nullptr, 1000)) { /* Only poll standard SDL events and SDL_EVENT_USERS meant to create dialogs. @@ -1397,7 +1397,7 @@ static DWORD WINAPI sdl_client_thread_proc(SdlContext* sdl) static BOOL sdl_client_global_init() { #if defined(_WIN32) - WSADATA wsaData = { 0 }; + WSADATA wsaData = {}; const DWORD wVersionRequested = MAKEWORD(1, 1); const int rc = WSAStartup(wVersionRequested, &wsaData); if (rc != 0) diff --git a/client/SDL/SDL3/sdl_utils.cpp b/client/SDL/SDL3/sdl_utils.cpp index e46edb634..e2234d659 100644 --- a/client/SDL/SDL3/sdl_utils.cpp +++ b/client/SDL/SDL3/sdl_utils.cpp @@ -198,7 +198,7 @@ BOOL sdl_push_user_event(Uint32 type, ...) SDL_Event ev = {}; SDL_UserEvent* event = &ev.user; - va_list ap; + va_list ap = {}; va_start(ap, type); event->type = type; switch (type) @@ -331,7 +331,7 @@ HANDLE WinPREvent::handle() const bool sdl_push_quit() { - SDL_Event ev = { 0 }; + SDL_Event ev = {}; ev.type = SDL_EVENT_QUIT; SDL_PushEvent(&ev); return true; diff --git a/client/SDL/common/aad/sdl_webview.cpp b/client/SDL/common/aad/sdl_webview.cpp index b4df75b8f..c887f9061 100644 --- a/client/SDL/common/aad/sdl_webview.cpp +++ b/client/SDL/common/aad/sdl_webview.cpp @@ -107,7 +107,7 @@ BOOL sdl_webview_get_access_token(freerdp* instance, AccessTokenType tokenType, "ACCESS_TOKEN_TYPE_AAD expected 2 additional arguments, but got %" PRIuz ", ignoring", count); - va_list ap; + va_list ap = {}; va_start(ap, count); const char* scope = va_arg(ap, const char*); const char* req_cnf = va_arg(ap, const char*); diff --git a/client/X11/xf_utils.c b/client/X11/xf_utils.c index e9e28c904..7355e2587 100644 --- a/client/X11/xf_utils.c +++ b/client/X11/xf_utils.c @@ -34,7 +34,7 @@ static const DWORD log_level = WLOG_TRACE; static void write_log(wLog* log, DWORD level, const char* fname, const char* fkt, size_t line, ...) { - va_list ap; + va_list ap = { 0 }; va_start(ap, line); WLog_PrintMessageVA(log, WLOG_MESSAGE_TEXT, level, line, fname, fkt, ap); va_end(ap); diff --git a/client/common/client.c b/client/common/client.c index 001ae7571..3d0b5ddf8 100644 --- a/client/common/client.c +++ b/client/common/client.c @@ -1127,7 +1127,7 @@ BOOL client_cli_get_access_token(freerdp* instance, AccessTokenType tokenType, c "ACCESS_TOKEN_TYPE_AAD expected 2 additional arguments, but got %" PRIuz ", ignoring", count); - va_list ap; + va_list ap = { 0 }; va_start(ap, count); const char* scope = va_arg(ap, const char*); const char* req_cnf = va_arg(ap, const char*); diff --git a/client/common/client_cliprdr_file.c b/client/common/client_cliprdr_file.c index 2f20327e0..2406cf389 100644 --- a/client/common/client_cliprdr_file.c +++ b/client/common/client_cliprdr_file.c @@ -625,7 +625,7 @@ static void writelog(wLog* log, DWORD level, const char* fname, const char* fkt, if (!WLog_IsLevelActive(log, level)) return; - va_list ap; + va_list ap = { 0 }; va_start(ap, line); WLog_PrintMessageVA(log, WLOG_MESSAGE_TEXT, level, line, fname, fkt, ap); va_end(ap); diff --git a/client/common/file.c b/client/common/file.c index c4634f059..5ddeb0c3b 100644 --- a/client/common/file.c +++ b/client/common/file.c @@ -1425,7 +1425,7 @@ WINPR_ATTR_FORMAT_ARG(3, 4) static SSIZE_T freerdp_client_write_setting_to_buffer(char** buffer, size_t* bufferSize, WINPR_FORMAT_ARG const char* fmt, ...) { - va_list ap; + va_list ap = { 0 }; SSIZE_T len = 0; char* buf = NULL; size_t bufSize = 0; diff --git a/client/common/test/TestClientRdpFile.c b/client/common/test/TestClientRdpFile.c index e51123e72..03f1bc3b6 100644 --- a/client/common/test/TestClientRdpFile.c +++ b/client/common/test/TestClientRdpFile.c @@ -239,7 +239,7 @@ static char* append(const char* fmt, ...) { int rc = 0; char* dst = NULL; - va_list ap; + va_list ap = { 0 }; va_start(ap, fmt); rc = vsnprintf(NULL, 0, fmt, ap); diff --git a/libfreerdp/codec/dsp_fdk_aac.c b/libfreerdp/codec/dsp_fdk_aac.c index 93227477c..2165863ce 100644 --- a/libfreerdp/codec/dsp_fdk_aac.c +++ b/libfreerdp/codec/dsp_fdk_aac.c @@ -32,7 +32,7 @@ static void write_log(unsigned log_level, const char* fmt, ...) { char buffer[1024] = { 0 }; - va_list ap; + va_list ap = { 0 }; va_start(ap, fmt); vsnprintf(buffer, sizeof(buffer), fmt, ap); va_end(ap); diff --git a/libfreerdp/core/aad.c b/libfreerdp/core/aad.c index 6f946230d..8b40cbe1f 100644 --- a/libfreerdp/core/aad.c +++ b/libfreerdp/core/aad.c @@ -57,7 +57,7 @@ static BOOL generate_pop_key(rdpAad* aad); WINPR_ATTR_FORMAT_ARG(2, 3) static SSIZE_T stream_sprintf(wStream* s, WINPR_FORMAT_ARG const char* fmt, ...) { - va_list ap; + va_list ap = { 0 }; va_start(ap, fmt); const int rc = vsnprintf(NULL, 0, fmt, ap); va_end(ap); diff --git a/libfreerdp/core/freerdp.c b/libfreerdp/core/freerdp.c index a42f66689..ae55fe34a 100644 --- a/libfreerdp/core/freerdp.c +++ b/libfreerdp/core/freerdp.c @@ -1302,7 +1302,7 @@ void clearChannelError(rdpContext* context) WINPR_ATTR_FORMAT_ARG(3, 4) void setChannelError(rdpContext* context, UINT errorNum, WINPR_FORMAT_ARG const char* format, ...) { - va_list ap; + va_list ap = { 0 }; va_start(ap, format); WINPR_ASSERT(context); diff --git a/libfreerdp/core/gateway/http.c b/libfreerdp/core/gateway/http.c index 9ff9bd906..aa1e3027a 100644 --- a/libfreerdp/core/gateway/http.c +++ b/libfreerdp/core/gateway/http.c @@ -345,7 +345,7 @@ BOOL http_context_set_pragma(HttpContext* context, WINPR_FORMAT_ARG const char* free(context->Pragma); context->Pragma = NULL; - va_list ap; + va_list ap = { 0 }; va_start(ap, Pragma); return list_append(context, Pragma, ap); } @@ -356,7 +356,7 @@ BOOL http_context_append_pragma(HttpContext* context, const char* Pragma, ...) if (!context || !Pragma) return FALSE; - va_list ap; + va_list ap = { 0 }; va_start(ap, Pragma); return list_append(context, Pragma, ap); } @@ -551,7 +551,7 @@ WINPR_ATTR_FORMAT_ARG(2, 3) static BOOL http_encode_print(wStream* s, WINPR_FORMAT_ARG const char* fmt, ...) { char* str = NULL; - va_list ap; + va_list ap = { 0 }; int length = 0; int used = 0; diff --git a/libfreerdp/core/gateway/tsg.c b/libfreerdp/core/gateway/tsg.c index 06592d5d0..da0b7d339 100644 --- a/libfreerdp/core/gateway/tsg.c +++ b/libfreerdp/core/gateway/tsg.c @@ -762,7 +762,7 @@ WINPR_ATTR_FORMAT_ARG(3, 4) static BOOL tsg_print(char** buffer, size_t* len, WINPR_FORMAT_ARG const char* fmt, ...) { int rc = 0; - va_list ap; + va_list ap = { 0 }; if (!buffer || !len || !fmt) return FALSE; va_start(ap, fmt); diff --git a/libfreerdp/core/test/TestConnect.c b/libfreerdp/core/test/TestConnect.c index 31f6019ef..24874a622 100644 --- a/libfreerdp/core/test/TestConnect.c +++ b/libfreerdp/core/test/TestConnect.c @@ -186,7 +186,7 @@ static int testAbort(int port) static char* concatenate(size_t count, ...) { char* rc = NULL; - va_list ap; + va_list ap = { 0 }; va_start(ap, count); rc = _strdup(va_arg(ap, char*)); for (size_t x = 1; x < count; x++) diff --git a/libfreerdp/core/timezone.c b/libfreerdp/core/timezone.c index 4facc0874..cfd225304 100644 --- a/libfreerdp/core/timezone.c +++ b/libfreerdp/core/timezone.c @@ -78,7 +78,7 @@ static void log_print(wLog* log, DWORD level, const char* file, const char* fkt, if (!WLog_IsLevelActive(log, level)) return; - va_list ap; + va_list ap = { 0 }; va_start(ap, line); WLog_PrintMessageVA(log, WLOG_MESSAGE_TEXT, level, line, file, fkt, ap); va_end(ap); diff --git a/winpr/libwinpr/comm/comm.c b/winpr/libwinpr/comm/comm.c index dc4b02eb4..8ac2a2b2f 100644 --- a/winpr/libwinpr/comm/comm.c +++ b/winpr/libwinpr/comm/comm.c @@ -134,7 +134,7 @@ void CommLog_Print(DWORD level, ...) if (!CommInitialized()) return; - va_list ap; + va_list ap = { 0 }; va_start(ap, level); WLog_PrintVA(sLog, level, ap); va_end(ap); diff --git a/winpr/libwinpr/crt/string.c b/winpr/libwinpr/crt/string.c index e385276f7..d0bd38495 100644 --- a/winpr/libwinpr/crt/string.c +++ b/winpr/libwinpr/crt/string.c @@ -177,7 +177,7 @@ BOOL winpr_str_append(const char* what, char* buffer, size_t size, const char* s WINPR_ATTR_FORMAT_ARG(3, 4) int winpr_asprintf(char** s, size_t* slen, WINPR_FORMAT_ARG const char* templ, ...) { - va_list ap; + va_list ap = { 0 }; va_start(ap, templ); int rc = winpr_vasprintf(s, slen, templ, ap); @@ -188,7 +188,7 @@ int winpr_asprintf(char** s, size_t* slen, WINPR_FORMAT_ARG const char* templ, . WINPR_ATTR_FORMAT_ARG(3, 0) int winpr_vasprintf(char** s, size_t* slen, WINPR_FORMAT_ARG const char* templ, va_list oap) { - va_list ap; + va_list ap = { 0 }; *s = NULL; *slen = 0; diff --git a/winpr/libwinpr/timezone/timezone.c b/winpr/libwinpr/timezone/timezone.c index 3f179f39c..7b8422bf6 100644 --- a/winpr/libwinpr/timezone/timezone.c +++ b/winpr/libwinpr/timezone/timezone.c @@ -595,7 +595,7 @@ static void log_print(wLog* log, DWORD level, const char* file, const char* fkt, if (!WLog_IsLevelActive(log, level)) return; - va_list ap; + va_list ap = { 0 }; va_start(ap, line); WLog_PrintMessageVA(log, WLOG_MESSAGE_TEXT, level, line, file, fkt, ap); va_end(ap); diff --git a/winpr/libwinpr/utils/collections/ArrayList.c b/winpr/libwinpr/utils/collections/ArrayList.c index 2f8ff9182..05d5afb5c 100644 --- a/winpr/libwinpr/utils/collections/ArrayList.c +++ b/winpr/libwinpr/utils/collections/ArrayList.c @@ -529,7 +529,7 @@ wObject* ArrayList_Object(wArrayList* arrayList) BOOL ArrayList_ForEach(wArrayList* arrayList, ArrayList_ForEachFkt fkt, ...) { BOOL rc = 0; - va_list ap; + va_list ap = { 0 }; va_start(ap, fkt); rc = ArrayList_ForEachAP(arrayList, fkt, ap); va_end(ap); diff --git a/winpr/libwinpr/utils/collections/PubSub.c b/winpr/libwinpr/utils/collections/PubSub.c index b95f26d02..4ab29ab81 100644 --- a/winpr/libwinpr/utils/collections/PubSub.c +++ b/winpr/libwinpr/utils/collections/PubSub.c @@ -121,7 +121,7 @@ int PubSub_Subscribe(wPubSub* pubSub, const char* EventName, ...) int status = -1; WINPR_ASSERT(pubSub); - va_list ap; + va_list ap = { 0 }; va_start(ap, EventName); pEventHandler EventHandler = va_arg(ap, pEventHandler); @@ -154,7 +154,7 @@ int PubSub_Unsubscribe(wPubSub* pubSub, const char* EventName, ...) WINPR_ASSERT(pubSub); WINPR_ASSERT(EventName); - va_list ap; + va_list ap = { 0 }; va_start(ap, EventName); pEventHandler EventHandler = va_arg(ap, pEventHandler);