From: Lennart Poettering Date: Tue, 3 Feb 2015 17:17:00 +0000 (+0100) Subject: journald: fix some xsprrintf() buffer size fallout X-Git-Tag: v219~165 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=3b97fcbd28f92a1e51887fef5de8844a89bde523;hp=86caf09519c702f38552ba4f789b55a562fc29c5;ds=sidebyside journald: fix some xsprrintf() buffer size fallout --- diff --git a/src/journal/journald-kmsg.c b/src/journal/journald-kmsg.c index 0b02eff6e..c4216c404 100644 --- a/src/journal/journald-kmsg.c +++ b/src/journal/journald-kmsg.c @@ -40,7 +40,7 @@ void server_forward_kmsg( const struct ucred *ucred) { struct iovec iovec[5]; - char header_priority[4], + char header_priority[DECIMAL_STR_MAX(priority) + 3], header_pid[sizeof("[]: ")-1 + DECIMAL_STR_MAX(pid_t) + 1]; int n = 0; char *ident_buf = NULL; diff --git a/src/journal/journald-syslog.c b/src/journal/journald-syslog.c index 355f6e6a4..7d545ca31 100644 --- a/src/journal/journald-syslog.c +++ b/src/journal/journald-syslog.c @@ -124,7 +124,7 @@ static void forward_syslog_raw(Server *s, int priority, const char *buffer, cons void server_forward_syslog(Server *s, int priority, const char *identifier, const char *message, const struct ucred *ucred, const struct timeval *tv) { struct iovec iovec[5]; - char header_priority[4], header_time[64], + char header_priority[DECIMAL_STR_MAX(priority) + 3], header_time[64], header_pid[sizeof("[]: ")-1 + DECIMAL_STR_MAX(pid_t) + 1]; int n = 0; time_t t;