perfetto: fix MSAN bugs in ftrace muxer

Off-by-one error and uninitialized mock event.

Change-Id: Iba80854f9bbd8d54df48fe0f75877a37650587ca
diff --git a/src/traced/probes/ftrace/ftrace_config_muxer_unittest.cc b/src/traced/probes/ftrace/ftrace_config_muxer_unittest.cc
index 399af68..f76b7ae 100644
--- a/src/traced/probes/ftrace/ftrace_config_muxer_unittest.cc
+++ b/src/traced/probes/ftrace/ftrace_config_muxer_unittest.cc
@@ -206,6 +206,7 @@
   Event event_to_return;
   event_to_return.name = "cpu_frequency";
   event_to_return.group = "power";
+  event_to_return.ftrace_event_id = 1;
   ON_CALL(*mock_table, GetOrCreateEvent(GroupAndName("power", "cpu_frequency")))
       .WillByDefault(Return(&event_to_return));
   EXPECT_CALL(*mock_table,
diff --git a/src/traced/probes/ftrace/proto_translation_table.cc b/src/traced/probes/ftrace/proto_translation_table.cc
index c158aa5..4a0f365 100644
--- a/src/traced/probes/ftrace/proto_translation_table.cc
+++ b/src/traced/probes/ftrace/proto_translation_table.cc
@@ -506,7 +506,7 @@
 }
 
 bool EventFilter::IsEventEnabled(size_t ftrace_event_id) const {
-  if (ftrace_event_id == 0 || ftrace_event_id > enabled_ids_.size())
+  if (ftrace_event_id == 0 || ftrace_event_id >= enabled_ids_.size())
     return false;
   return enabled_ids_[ftrace_event_id];
 }