Skip to content

Commit

Permalink
Fix more of uninitialized struct user_pass local vars
Browse files Browse the repository at this point in the history
Not all of these touch uninitialzed members of the struct, but that
could change in future.

Change-Id: I71bc847b48da54b70f60ccd7c4521ec699daf9cb
Signed-off-by: Selva Nair <[email protected]>
Acked-by: Gert Doering <[email protected]>
Message-Id: <[email protected]>
URL: https://www.mail-archive.com/[email protected]/msg29152.html
Signed-off-by: Gert Doering <[email protected]>
(cherry picked from commit aa1dd09)
  • Loading branch information
selvanair authored and cron2 committed Sep 10, 2024
1 parent 9e1598d commit f9ab7ed
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/openvpn/auth_token.c
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,7 @@ check_send_auth_token(struct context *c)
}

struct user_pass up;
CLEAR(up);
strncpynt(up.username, multi->locked_username, sizeof(up.username));

generate_auth_token(&up, multi);
Expand Down
1 change: 1 addition & 0 deletions src/openvpn/pkcs11.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ _pkcs11_openvpn_pin_prompt(
{
struct user_pass token_pass;
char prompt[1024];
CLEAR(token_pass);

(void)global_data;
(void)user_data;
Expand Down
2 changes: 1 addition & 1 deletion src/openvpn/socks.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ socks_username_password_auth(struct socks_proxy_info *p,
ssize_t size;
bool ret = false;

creds.defined = 0;
CLEAR(creds);
if (!get_user_pass(&creds, p->authfile, UP_TYPE_SOCKS, GET_USER_PASS_MANAGEMENT))
{
msg(M_NONFATAL, "SOCKS failed to get username/password.");
Expand Down

0 comments on commit f9ab7ed

Please sign in to comment.