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-22 17:11:43 -05:00
parent fa5aea80c5
commit 7e56a49e23

View File

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