mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2025-01-03 07:31:54 +00:00
Unix socket: Path length check directly before copying the path.
This is not needed as the string is always short enough, anyway it may be needed in future and one strlen during BIRD start is cheap enough.
This commit is contained in:
parent
7b91a3473c
commit
33e07e8114
@ -1493,7 +1493,9 @@ sk_open_unix(sock *s, char *name)
|
|||||||
if (fcntl(fd, F_SETFL, O_NONBLOCK) < 0)
|
if (fcntl(fd, F_SETFL, O_NONBLOCK) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
/* Path length checked in test_old_bird() */
|
/* Path length checked in test_old_bird() but we may need unix sockets for other reasons in future */
|
||||||
|
ASSERT_DIE(strlen(name) < sizeof(sa.sun_path));
|
||||||
|
|
||||||
sa.sun_family = AF_UNIX;
|
sa.sun_family = AF_UNIX;
|
||||||
strcpy(sa.sun_path, name);
|
strcpy(sa.sun_path, name);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user