mirror of
https://gitlab.labs.nic.cz/labs/bird.git
synced 2024-05-11 16:54:54 +00:00
Buffer overflow fix.
This commit is contained in:
@@ -254,7 +254,7 @@ server_connect(void)
|
||||
die("Cannot create socket: %m");
|
||||
bzero(&sa, sizeof(sa));
|
||||
sa.sun_family = AF_UNIX;
|
||||
strcpy(sa.sun_path, server_path);
|
||||
strncpy(sa.sun_path, server_path, sizeof(sa.sun_path));
|
||||
if (connect(server_fd, (struct sockaddr *) &sa, SUN_LEN(&sa)) < 0)
|
||||
die("Unable to connect to server control socket (%s): %m", server_path);
|
||||
if (fcntl(server_fd, F_SETFL, O_NONBLOCK) < 0)
|
||||
|
Reference in New Issue
Block a user