[Openvpn-devel,1/3] auth_token_kt: ensure key_type object is initialized

Message ID 20191110133525.6069-1-a@unstable.cc
State Accepted
Headers show
Series [Openvpn-devel,1/3] auth_token_kt: ensure key_type object is initialized | expand

Commit Message

Antonio Quartulli Nov. 10, 2019, 2:35 a.m. UTC
Fixes the following warning:

auth_token.c: In function 'auth_token_init_secret':
auth_token.c:47: warning: 'kt.cipher_length' is used uninitialized in this function
auth_token.c:34: note: 'kt.cipher_length' was declared here

Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Signed-off-by: Antonio Quartulli <a@unstable.cc>
---
 src/openvpn/auth_token.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Arne Schwabe Nov. 10, 2019, 3:38 a.m. UTC | #1
Am 10.11.19 um 14:35 schrieb Antonio Quartulli:
> Fixes the following warning:
> 
> auth_token.c: In function 'auth_token_init_secret':
> auth_token.c:47: warning: 'kt.cipher_length' is used uninitialized in this function
> auth_token.c:34: note: 'kt.cipher_length' was declared here
> 
> Signed-off-by: Arne Schwabe <arne@rfc2549.org>
> Signed-off-by: Antonio Quartulli <a@unstable.cc>
> ---
>  src/openvpn/auth_token.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/openvpn/auth_token.c b/src/openvpn/auth_token.c
> index 1edc8069..6275299d 100644
> --- a/src/openvpn/auth_token.c
> +++ b/src/openvpn/auth_token.c
> @@ -31,7 +31,7 @@ const char *auth_token_pem_name = "OpenVPN auth-token server key";
>  static struct key_type
>  auth_token_kt(void)
>  {
> -    struct key_type kt;
> +    struct key_type kt = { 0 };
>      /* We do not encrypt our session tokens */
>      kt.cipher = NULL;
>      kt.digest = md_kt_get("SHA256");
> 

Acked-by: Arne Schwabe <arne@rfc2549.org>

Arne
Gert Doering Nov. 10, 2019, 5:49 a.m. UTC | #2
Your patch has been applied to the master branch.

commit 9c380048a36cd1d1565607b5a0bee0ebbb8b1465
Author: Antonio Quartulli
Date:   Sun Nov 10 14:35:23 2019 +0100

     auth_token_kt: ensure key_type object is initialized

     Signed-off-by: Arne Schwabe <arne@rfc2549.org>
     Signed-off-by: Antonio Quartulli <a@unstable.cc>
     Acked-by: Gert Doering <gert@greenie.muc.de>
     Message-Id: <20191110133525.6069-1-a@unstable.cc>
     URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg19092.html
     Signed-off-by: Gert Doering <gert@greenie.muc.de>


--
kind regards,

Gert Doering
Gert Doering Nov. 10, 2019, 5:53 a.m. UTC | #3
Your patch has been applied to the master branch.

(Resent with correct Acked-By:)

commit 9d0b95c45130af2f91fa2195c483e2c7461c0f40
Author: Antonio Quartulli
Date:   Sun Nov 10 14:35:23 2019 +0100

     auth_token_kt: ensure key_type object is initialized

     Signed-off-by: Arne Schwabe <arne@rfc2549.org>
     Signed-off-by: Antonio Quartulli <a@unstable.cc>
     Acked-by: Arne Schwabe <arne@rfc2549.org>
     Message-Id: <20191110133525.6069-1-a@unstable.cc>
     URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg19092.html
     Signed-off-by: Gert Doering <gert@greenie.muc.de>


--
kind regards,

Gert Doering

Patch

diff --git a/src/openvpn/auth_token.c b/src/openvpn/auth_token.c
index 1edc8069..6275299d 100644
--- a/src/openvpn/auth_token.c
+++ b/src/openvpn/auth_token.c
@@ -31,7 +31,7 @@  const char *auth_token_pem_name = "OpenVPN auth-token server key";
 static struct key_type
 auth_token_kt(void)
 {
-    struct key_type kt;
+    struct key_type kt = { 0 };
     /* We do not encrypt our session tokens */
     kt.cipher = NULL;
     kt.digest = md_kt_get("SHA256");