From c5cca3d3eedb29b3cf3e3a976eeb9fe127f19f6d Mon Sep 17 00:00:00 2001 From: Wolfgang Popp Date: Tue, 9 Jan 2018 13:19:05 +0100 Subject: [PATCH] Fix syslog header truncation The priority value in the syslog header is between 0 (one digit) and 191 (three digits). The call to snprintf() might have cut off the whitespace before the timestamp field of the header for priority values greater than 99. --- src/netlog-network.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/netlog-network.c b/src/netlog-network.c index f7c0f65..ab88c93 100644 --- a/src/netlog-network.c +++ b/src/netlog-network.c @@ -113,9 +113,9 @@ int manager_push_to_network(Manager *m, const char *hostname, const char *pid, const struct timeval *tv) { - char header_priority[sizeof("< >1 ") + 1]; + char header_priority[sizeof("< >1 ")]; char header_time[FORMAT_TIMESTAMP_MAX]; - uint16_t makepri; + uint8_t makepri; struct iovec iov[13]; int n = 0;