Merge "liblog: Harden log_id check."
am: c280143d9b
Change-Id: I2a87f95287be7ee8009cc9c56c7bbc82f1673b99
This commit is contained in:
commit
cafb1b7776
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