mirror of
https://github.com/NixOS/nix
synced 2025-07-08 06:53:54 +02:00
createUnixDomainSocket(): Fix off-by-one error in copying the socket path
Reported by Kane York.
(cherry picked from commit 2292814049
)
This commit is contained in:
parent
c728d375de
commit
8b04d28a5b
1 changed files with 1 additions and 1 deletions
|
@ -967,7 +967,7 @@ static void daemonLoop(char * * argv)
|
|||
|
||||
struct sockaddr_un addr;
|
||||
addr.sun_family = AF_UNIX;
|
||||
if (socketPathRel.size() >= sizeof(addr.sun_path))
|
||||
if (socketPathRel.size() + 1 >= sizeof(addr.sun_path))
|
||||
throw Error(format("socket path '%1%' is too long") % socketPathRel);
|
||||
strcpy(addr.sun_path, socketPathRel.c_str());
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue