Logger: only log printable characters and newlines

X-Gentoo-Bug: 651412
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=651412
This commit is contained in:
William Hubbs 2018-05-09 17:30:08 -05:00
parent a3d0e293ee
commit 2b1392af2f

View File

@ -87,6 +87,7 @@ write_log(int logfd, const char *buffer, size_t bytes)
} }
if (!in_escape) { if (!in_escape) {
if (isprint((unsigned char) *p) || *p == '\n')
if (write(logfd, p++, 1) == -1) if (write(logfd, p++, 1) == -1)
eerror("write: %s", strerror(errno)); eerror("write: %s", strerror(errno));
continue; continue;