mirror of
https://github.com/clearlinux/systemd-stable.git
synced 2026-09-06 21:51:37 +00:00
shared: handle unnamed sockets in socket_address_equal()
Make sure we don't inspect sun_path of unnamed sockets. Since we cannot know if two unnamed sockets' adresses refer to the same socket, just return false. (cherry picked from commit710708a54c) (cherry picked from commit04691e6f81)
This commit is contained in:
committed by
Zbigniew Jędrzejewski-Szmek
parent
cd9740bae3
commit
40fa3b1875
@@ -349,6 +349,10 @@ bool socket_address_equal(const SocketAddress *a, const SocketAddress *b) {
|
||||
break;
|
||||
|
||||
case AF_UNIX:
|
||||
if (a->size <= offsetof(struct sockaddr_un, sun_path) ||
|
||||
b->size <= offsetof(struct sockaddr_un, sun_path))
|
||||
return false;
|
||||
|
||||
if ((a->sockaddr.un.sun_path[0] == 0) != (b->sockaddr.un.sun_path[0] == 0))
|
||||
return false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user