Skip to content

Commit

Permalink
Don't read past the end of sockaddr for AF_UNIX
Browse files Browse the repository at this point in the history
Incoming connections for example have the 'family' set but no path.
  • Loading branch information
remram44 committed Aug 28, 2023
1 parent 6d1d97c commit 44820cc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion reprozip/native/syscalls.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ static int record_connection(struct Process *process, int inbound,
snprintf(buffer, 512, "[%s]:%d", buf, ntohs(address_->sin6_port));
db_add_connection(process->identifier, inbound, "INET6", NULL, buffer);
}
else if(family == AF_UNIX)
else if(family == AF_UNIX && addrlen > sizeof(short))
{
struct sockaddr_un *address_ = address;
char buf[109];
Expand Down

0 comments on commit 44820cc

Please sign in to comment.