]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
If the notification message length is 0, ignore the message (#4237)
authorJorge Niedbalski <jorge.niedbalski@canonical.com>
Wed, 28 Sep 2016 21:25:50 +0000 (18:25 -0300)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 29 Sep 2016 09:26:16 +0000 (05:26 -0400)
Fixes #4234.

Signed-off-by: Jorge Niedbalski <jnr@metaklass.org>
src/core/manager.c

index fa8deb9b1bebfc4a9a22291ca9b9372862464a38..43e231c3281edb11896b6da726b78a8a45e0267b 100644 (file)
@@ -1721,6 +1721,10 @@ static int manager_dispatch_notify_fd(sd_event_source *source, int fd, uint32_t
 
                 return -errno;
         }
+        if (n == 0) {
+                log_debug("Got zero-length notification message. Ignoring.");
+                return 0;
+        }
 
         CMSG_FOREACH(cmsg, &msghdr) {
                 if (cmsg->cmsg_level == SOL_SOCKET && cmsg->cmsg_type == SCM_RIGHTS) {