diff --git a/src/core/dbus-socket.c b/src/core/dbus-socket.c index 913cc74918..da60cf110a 100644 --- a/src/core/dbus-socket.c +++ b/src/core/dbus-socket.c @@ -360,6 +360,9 @@ static int bus_socket_set_transient_property( return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Unknown Socket type: %s", t); if (p->type != SOCKET_SOCKET) { + if (!path_is_valid(p->path)) + return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid socket path: %s", t); + p->path = strdup(a); path_simplify(p->path, false);