From: Lev Stipakov Date: Fri, 7 Jan 2022 12:35:50 +0000 (+0200) Subject: auth_token.c: add NULL initialization X-Git-Tag: v2.5.6~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=813d1ee3c8b6a914599e4705eee3b8835d606e4b;p=thirdparty%2Fopenvpn.git auth_token.c: add NULL initialization This fixes error C4703: potentially uninitialized local pointer variable 'b64output' used found by arm64 msvc compiler with SDL enabled. Not sure why this is not triggered on x86/x64. Signed-off-by: Lev Stipakov Acked-by: Antonio Quartulli Acked-by: Arne Schwabe Message-Id: <20220107123550.188-1-lstipakov@gmail.com> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg23511.html Signed-off-by: Gert Doering (cherry picked from commit 4b6073b8253dafeb425361fb55bab0f2cdc5474f) --- diff --git a/src/openvpn/auth_token.c b/src/openvpn/auth_token.c index 0ea6d1832..ca7e5a4dd 100644 --- a/src/openvpn/auth_token.c +++ b/src/openvpn/auth_token.c @@ -260,7 +260,7 @@ generate_auth_token(const struct user_pass *up, struct tls_multi *multi) ASSERT(buf_write(&token, ×tamp, sizeof(timestamp))); ASSERT(buf_write(&token, hmac_output, sizeof(hmac_output))); - char *b64output; + char *b64output = NULL; openvpn_base64_encode(BPTR(&token), BLEN(&token), &b64output); struct buffer session_token = alloc_buf_gc(