Merge "LogAudit.cpp: replace newlines with spaces in audit messages" am: 5badada997 am: 5083c589fa am: 48ff04f986

am: 196969f951

Change-Id: I79e02a0348170723116fc8fc8f5fcd83dde3adbc
This commit is contained in:
Nick Kralevich 2017-01-03 22:55:02 +00:00 committed by android-build-merger
commit 43912b1674
1 changed files with 7 additions and 0 deletions

View File

@ -98,6 +98,13 @@ int LogAudit::logPrint(const char *fmt, ...) {
}
char *cp;
// Work around kernels missing
// https://github.com/torvalds/linux/commit/b8f89caafeb55fba75b74bea25adc4e4cd91be67
// Such kernels improperly add newlines inside audit messages.
while ((cp = strchr(str, '\n'))) {
*cp = ' ';
}
while ((cp = strstr(str, " "))) {
memmove(cp, cp + 1, strlen(cp + 1) + 1);
}