Skip to content

Commit

Permalink
fixup! Fix two instances of -Wformat-truncation
Browse files Browse the repository at this point in the history
Change-Id: I5638c36bc13222ce88108f9dd4285a6987ad0ebd
  • Loading branch information
schwabe committed Mar 25, 2024
1 parent a698723 commit 50c1dbc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/openvpn/socks.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,11 @@ socks_username_password_auth(struct socks_proxy_info *p,
"Authentication not possible.");
goto cleanup;
}
snprintf(to_send, sizeof(to_send), "\x01%c%s%c%s", (int) strlen(creds.username),
creds.username, (int) strlen(creds.password), creds.password);
int sret = snprintf(to_send, sizeof(to_send), "\x01%c%s%c%s",
(int) strlen(creds.username), creds.username,
(int) strlen(creds.password), creds.password);
ASSERT(sret <= sizeof(to_send));

size = send(sd, to_send, strlen(to_send), MSG_NOSIGNAL);

if (size != strlen(to_send))
Expand Down

0 comments on commit 50c1dbc

Please sign in to comment.