Merge "liblog: Harden log_id check."
This commit is contained in:
commit
c280143d9b
|
@ -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…
Reference in New Issue