summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJorge Niedbalski <jorge.niedbalski@canonical.com>2016-09-28 18:25:50 -0300
committerLuke Shumaker <lukeshu@sbcglobal.net>2016-10-21 18:29:52 -0400
commitb887dcaf758d22ce2ea607f7811e3c1915a34c81 (patch)
treec206fcf22d9b61fb3928c8753808c31fe2206dd7
parent38b383d9fe0f5c4e987c1e01136ae6073076fee3 (diff)
If the notification message length is 0, ignore the message (#4237)
Fixes #4234. Signed-off-by: Jorge Niedbalski <jnr@metaklass.org> (cherry picked from commit 531ac2b2349da02acc9c382849758e07eb92b020)
-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 4d84a0b37e..a085ed899a 100644
--- a/src/core/manager.c
+++ b/src/core/manager.c
@@ -1648,6 +1648,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) {