Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: Argument 3 of getsockname and accept should be socklen_t #15

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion net_bsd_lcl.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ proto_accept_connection(int listener_fd, int *read_fd, int *write_fd,
{
int fd;
static struct sockaddr_un address;
int addr_length = sizeof(address);
socklen_t addr_length = sizeof(address);

fd = accept(listener_fd, (struct sockaddr *) &address, &addr_length);
if (fd < 0) {
Expand Down
4 changes: 2 additions & 2 deletions net_bsd_tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ proto_make_listener(Var desc, int *fd, Var * canon, const char **name)
return e;
}
if (port == 0) {
size_t length = sizeof(address);
socklen_t length = sizeof(address);

if (getsockname(s, (struct sockaddr *) &address, &length) < 0) {
log_perror("Discovering local port number");
Expand Down Expand Up @@ -139,7 +139,7 @@ proto_accept_connection(int listener_fd, int *read_fd, int *write_fd,
int timeout = server_int_option("name_lookup_timeout", 5);
int fd;
struct sockaddr_in address;
size_t addr_length = sizeof(address);
socklen_t addr_length = sizeof(address);
static Stream *s = 0;

if (!s)
Expand Down