chiark / gitweb /
core: extra paranoia when deserializing kdbus fd
authorLennart Poettering <lennart@poettering.net>
Mon, 2 Dec 2013 22:10:28 +0000 (23:10 +0100)
committerLennart Poettering <lennart@poettering.net>
Mon, 2 Dec 2013 22:32:34 +0000 (23:32 +0100)
src/core/manager.c

index badf19e..1949386 100644 (file)
@@ -2172,7 +2172,7 @@ int manager_deserialize(Manager *m, FILE *f, FDSet *fds) {
                 } else if (startswith(l, "kdbus-fd=")) {
                         int fd;
 
-                        if (safe_atoi(l + 9, &fd) < 0 || !fdset_contains(fds, fd))
+                        if (safe_atoi(l + 9, &fd) < 0 || fd < 0 || !fdset_contains(fds, fd))
                                 log_debug("Failed to parse kdbus fd: %s", l + 9);
                         else {
                                 if (m->kdbus_fd >= 0)