summaryrefslogtreecommitdiff
path: root/src/journal
diff options
context:
space:
mode:
Diffstat (limited to 'src/journal')
-rw-r--r--src/journal/journald-server.c2
-rw-r--r--src/journal/journald-syslog.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c
index f0117e742e..5befe93fd4 100644
--- a/src/journal/journald-server.c
+++ b/src/journal/journald-server.c
@@ -686,7 +686,7 @@ static void dispatch_message_real(
#ifdef HAVE_SELINUX
if (use_selinux()) {
if (label) {
- x = alloca(sizeof("_SELINUX_CONTEXT=") + label_len);
+ x = alloca(strlen("_SELINUX_CONTEXT=") + label_len + 1);
*((char*) mempcpy(stpcpy(x, "_SELINUX_CONTEXT="), label, label_len)) = 0;
IOVEC_SET_STRING(iovec[n++], x);
diff --git a/src/journal/journald-syslog.c b/src/journal/journald-syslog.c
index cbb944f287..fee7d91572 100644
--- a/src/journal/journald-syslog.c
+++ b/src/journal/journald-syslog.c
@@ -46,7 +46,7 @@ static void forward_syslog_iovec(Server *s, const struct iovec *iovec, unsigned
.msg_iovlen = n_iovec,
.msg_name = &sa,
.msg_namelen = offsetof(union sockaddr_union, un.sun_path)
- + sizeof("/run/systemd/journal/syslog") - 1,
+ + strlen("/run/systemd/journal/syslog"),
};
struct cmsghdr *cmsg;
union {