Merge "liblog: Harden log_id check." am: c280143d9b
am: cafb1b7776
Change-Id: I49af30395f3904a9e987b01150417ea449d4da3e
This commit is contained in:
commit
3ecffa294f
2 changed files with 2 additions and 2 deletions
|
|
@ -91,7 +91,7 @@ LIBLOG_HIDDEN struct android_log_transport_read logdLoggerRead = {
|
|||
|
||||
static int logdAvailable(log_id_t logId)
|
||||
{
|
||||
if (logId > LOG_ID_KERNEL) {
|
||||
if (logId >= LOG_ID_MAX) {
|
||||
return -EINVAL;
|
||||
}
|
||||
if (logId == LOG_ID_SECURITY) {
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ static void logdClose()
|
|||
|
||||
static int logdAvailable(log_id_t logId)
|
||||
{
|
||||
if (logId > LOG_ID_SECURITY) {
|
||||
if (logId >= LOG_ID_MAX || logId == LOG_ID_KERNEL) {
|
||||
return -EINVAL;
|
||||
}
|
||||
if (atomic_load(&logdLoggerWrite.context.sock) < 0) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue