commit: 2b1392af2fe9e5dfc8eda2f19d896efdc41840bf Author: William Hubbs <w.d.hubbs <AT> gmail <DOT> com> AuthorDate: Wed May 9 22:30:08 2018 +0000 Commit: William Hubbs <williamh <AT> gentoo <DOT> org> CommitDate: Wed May 9 22:30:08 2018 +0000 URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=2b1392af
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; }
