From dbf142ffe597b21aa09a47677ea2061b74a9354e Mon Sep 17 00:00:00 2001 From: Selva Nair Date: Thu, 27 Oct 2022 12:06:19 -0400 Subject: [PATCH] Do not copy auth_token username to itself - Fixes a potential mis-behaviour (strncpy with dest == src) introduced by commits ecad4839c (2.6) and 3d792ae955 (2.5). Reported by: Gert Doering Signed-off-by: Selva Nair Acked-by: Gert Doering Message-Id: <20221027160619.11894-1-selva.nair@gmail.com> URL: https://www.mail-archive.com/search?l=mid&q=20221027160619.11894-1-selva.nair@gmail.com Signed-off-by: Gert Doering --- src/openvpn/ssl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openvpn/ssl.c b/src/openvpn/ssl.c index 3106c738a..24e8ba632 100644 --- a/src/openvpn/ssl.c +++ b/src/openvpn/ssl.c @@ -2180,7 +2180,7 @@ key_method_2_write(struct buffer *buf, struct tls_multi *multi, struct tls_sessi goto error; } /* save username for auth-token which may get pushed later */ - if (session->opt->pull) + if (session->opt->pull && up != &auth_token) { strncpynt(auth_token.username, up->username, USER_PASS_LEN); } -- 2.47.2