Skip to content

Commit

Permalink
Fix sa_len in zap_sock get_name
Browse files Browse the repository at this point in the history
The `sa_len` argument is in-out. Its initial value should be set by the
caller.
  • Loading branch information
narategithub committed Aug 30, 2023
1 parent db4a71d commit 064fe78
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/src/zap/sock/zap_sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ static zap_err_t z_get_name(zap_ep_t ep, struct sockaddr *local_sa,
{
struct z_sock_ep *sep = (struct z_sock_ep *)ep;
int rc;
*sa_len = sizeof(struct sockaddr_in);
assert(sa_len && *sa_len > 0);
rc = getsockname(sep->sock, local_sa, sa_len);
if (rc)
goto err;
Expand Down

0 comments on commit 064fe78

Please sign in to comment.