X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fshared%2Fsocket-util.c;h=74d90fa2a9716df237aecc02f8098ccb4242f318;hb=0aa3b7830fd59d8b4ca275e9a9c4e79f8a23ff6d;hp=deecce8a8062da84ead7ec973323d0364ea8e84b;hpb=02233928a502e46fc125118dba7234ba3e48dc15;p=elogind.git
diff --git a/src/shared/socket-util.c b/src/shared/socket-util.c
index deecce8a8..74d90fa2a 100644
--- a/src/shared/socket-util.c
+++ b/src/shared/socket-util.c
@@ -19,24 +19,19 @@
along with systemd; If not, see .
***/
-#include
#include
#include
#include
-#include
#include
#include
#include
#include
-#include
#include
-#include
#include
#include "macro.h"
-#include "util.h"
-#include "mkdir.h"
#include "path-util.h"
+#include "util.h"
#include "socket-util.h"
#include "missing.h"
#include "fileio.h"
@@ -349,6 +344,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;