From 2b1392af2fe9e5dfc8eda2f19d896efdc41840bf Mon Sep 17 00:00:00 2001 From: William Hubbs Date: Wed, 9 May 2018 17:30:08 -0500 Subject: [PATCH] Logger: only log printable characters and newlines X-Gentoo-Bug: 651412 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=651412 --- src/rc/rc-logger.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/rc/rc-logger.c b/src/rc/rc-logger.c index 062ce3d9..1da3f59c 100644 --- a/src/rc/rc-logger.c +++ b/src/rc/rc-logger.c @@ -87,8 +87,9 @@ write_log(int logfd, const char *buffer, size_t bytes) } if (!in_escape) { - if (write(logfd, p++, 1) == -1) - eerror("write: %s", strerror(errno)); + if (isprint((unsigned char) *p) || *p == '\n') + if (write(logfd, p++, 1) == -1) + eerror("write: %s", strerror(errno)); continue; }