liblog: do not allow loggers to write to binary buffers
Do not write to binary buffers, this was already done for logd, but wasn't explicitly done for other loggers, so do that too. Test: unit tests Change-Id: Ia36e0d2e1b6c833780239a5ef459abea99bc4a1f
This commit is contained in:
parent
e2187bfbbc
commit
f48f685e60
1 changed files with 6 additions and 0 deletions
|
|
@ -307,6 +307,12 @@ int __android_log_write(int prio, const char* tag, const char* msg) {
|
|||
void __android_log_write_logger_data(__android_logger_data* logger_data, const char* msg) {
|
||||
ErrnoRestorer errno_restorer;
|
||||
|
||||
if (logger_data->buffer_id != LOG_ID_DEFAULT && logger_data->buffer_id != LOG_ID_MAIN &&
|
||||
logger_data->buffer_id != LOG_ID_SYSTEM && logger_data->buffer_id != LOG_ID_RADIO &&
|
||||
logger_data->buffer_id != LOG_ID_CRASH) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto tag_lock = std::shared_lock{default_tag_lock, std::defer_lock};
|
||||
if (logger_data->tag == nullptr) {
|
||||
tag_lock.lock();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue