mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 12:48:22 +00:00
localsocket: properly copy bindpath to new sockets from accept()
This commit is contained in:
@@ -690,6 +690,15 @@ static int localsock_accept(socket_t *_server, socket_t *_clientconnection, sock
|
||||
MUTEX_ACQUIRE(&binding->mutex);
|
||||
}
|
||||
|
||||
if (server->bindpath) {
|
||||
size_t length = strlen(server->bindpath) + 1;
|
||||
clientconnection->bindpath = alloc(length);
|
||||
if (clientconnection->bindpath == NULL)
|
||||
goto leave;
|
||||
|
||||
memcpy(clientconnection->bindpath, server->bindpath, length);
|
||||
}
|
||||
|
||||
// we have a valid pair and we have acquired the mutex already
|
||||
// configure the client connection. we don't lock it because it should only be
|
||||
// curretly accessible here anyways
|
||||
|
||||
Reference in New Issue
Block a user