summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJorge Niedbalski <jorge.niedbalski@canonical.com>2016-09-28 18:25:50 -0300
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-09-29 05:26:16 -0400
commit531ac2b2349da02acc9c382849758e07eb92b020 (patch)
tree36b06a5e4f9eb3f8ddf8a7c2029d6cacdf998afb
parent831d3dc8d7ab2719c90485274b537f4a7882fe66 (diff)
If the notification message length is 0, ignore the message (#4237)
Fixes #4234. Signed-off-by: Jorge Niedbalski <jnr@metaklass.org>
-rw-r--r--src/core/manager.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/manager.c b/src/core/manager.c
index fa8deb9b1b..43e231c328 100644
--- a/src/core/manager.c
+++ b/src/core/manager.c
@@ -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) {