Loading debuggerd/client/debuggerd_client.cpp +1 −1 Original line number Original line Diff line number Diff line Loading @@ -216,7 +216,7 @@ bool debuggerd_trigger_dump(pid_t tid, DebuggerdDumpType dump_type, unsigned int log_error(output_fd, 0, log_error(output_fd, 0, "received packet of unexpected length from tombstoned while reading %s response: " "received packet of unexpected length from tombstoned while reading %s response: " "expected %zd, received %zd", "expected %zd, received %zd", kind, sizeof(response), rc); kind, sizeof(*response), rc); return false; return false; } } return true; return true; Loading init/selinux.cpp +11 −10 Original line number Original line Diff line number Diff line Loading @@ -761,15 +761,7 @@ void SelinuxSetEnforcement() { constexpr size_t kKlogMessageSize = 1024; constexpr size_t kKlogMessageSize = 1024; void SelinuxAvcLog(char* buf, size_t buf_len) { void SelinuxAvcLog(char* buf) { CHECK_GT(buf_len, 0u); size_t str_len = strnlen(buf, buf_len); // trim newline at end of string if (buf[str_len - 1] == '\n') { buf[str_len - 1] = '\0'; } struct NetlinkMessage { struct NetlinkMessage { nlmsghdr hdr; nlmsghdr hdr; char buf[kKlogMessageSize]; char buf[kKlogMessageSize]; Loading Loading @@ -835,8 +827,17 @@ int SelinuxKlogCallback(int type, const char* fmt, ...) { if (length_written <= 0) { if (length_written <= 0) { return 0; return 0; } } // libselinux log messages usually contain a new line character, while // Android LOG() does not expect it. Remove it to avoid empty lines in // the log buffers. size_t str_len = strlen(buf); if (buf[str_len - 1] == '\n') { buf[str_len - 1] = '\0'; } if (type == SELINUX_AVC) { if (type == SELINUX_AVC) { SelinuxAvcLog(buf, sizeof(buf)); SelinuxAvcLog(buf); } else { } else { android::base::KernelLogger(android::base::MAIN, severity, "selinux", nullptr, 0, buf); android::base::KernelLogger(android::base::MAIN, severity, "selinux", nullptr, 0, buf); } } Loading Loading
debuggerd/client/debuggerd_client.cpp +1 −1 Original line number Original line Diff line number Diff line Loading @@ -216,7 +216,7 @@ bool debuggerd_trigger_dump(pid_t tid, DebuggerdDumpType dump_type, unsigned int log_error(output_fd, 0, log_error(output_fd, 0, "received packet of unexpected length from tombstoned while reading %s response: " "received packet of unexpected length from tombstoned while reading %s response: " "expected %zd, received %zd", "expected %zd, received %zd", kind, sizeof(response), rc); kind, sizeof(*response), rc); return false; return false; } } return true; return true; Loading
init/selinux.cpp +11 −10 Original line number Original line Diff line number Diff line Loading @@ -761,15 +761,7 @@ void SelinuxSetEnforcement() { constexpr size_t kKlogMessageSize = 1024; constexpr size_t kKlogMessageSize = 1024; void SelinuxAvcLog(char* buf, size_t buf_len) { void SelinuxAvcLog(char* buf) { CHECK_GT(buf_len, 0u); size_t str_len = strnlen(buf, buf_len); // trim newline at end of string if (buf[str_len - 1] == '\n') { buf[str_len - 1] = '\0'; } struct NetlinkMessage { struct NetlinkMessage { nlmsghdr hdr; nlmsghdr hdr; char buf[kKlogMessageSize]; char buf[kKlogMessageSize]; Loading Loading @@ -835,8 +827,17 @@ int SelinuxKlogCallback(int type, const char* fmt, ...) { if (length_written <= 0) { if (length_written <= 0) { return 0; return 0; } } // libselinux log messages usually contain a new line character, while // Android LOG() does not expect it. Remove it to avoid empty lines in // the log buffers. size_t str_len = strlen(buf); if (buf[str_len - 1] == '\n') { buf[str_len - 1] = '\0'; } if (type == SELINUX_AVC) { if (type == SELINUX_AVC) { SelinuxAvcLog(buf, sizeof(buf)); SelinuxAvcLog(buf); } else { } else { android::base::KernelLogger(android::base::MAIN, severity, "selinux", nullptr, 0, buf); android::base::KernelLogger(android::base::MAIN, severity, "selinux", nullptr, 0, buf); } } Loading