mirror of
https://github.com/haproxy/haproxy.git
synced 2026-05-28 04:12:17 -04:00
[BUG] fix off-by-one in path length in destroy_uxst_socket()
An off-by-one error was left in the computation of the unix socket path.
This commit is contained in:
parent
03f6d67c48
commit
10ae548052
1 changed files with 1 additions and 1 deletions
|
|
@ -198,7 +198,7 @@ static void destroy_uxst_socket(const char *path)
|
|||
|
||||
addr.sun_family = AF_UNIX;
|
||||
strncpy(addr.sun_path, path, sizeof(addr.sun_path));
|
||||
addr.sun_path[sizeof(addr.sun_path)] = 0;
|
||||
addr.sun_path[sizeof(addr.sun_path) - 1] = 0;
|
||||
ret = connect(sock, (struct sockaddr *)&addr, sizeof(addr));
|
||||
if (ret < 0 && errno == ECONNREFUSED) {
|
||||
/* Connect failed: the socket still exists but is not used
|
||||
|
|
|
|||
Loading…
Reference in a new issue