ios: Fix typo in checking thread_times values.

Change-Id: I29a9fa51721623dfd928727f7c9a1e425d36e2a3
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3264806
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Justin Cohen <justincohen@chromium.org>
GitOrigin-RevId: 4bf79bc2bfb1ae3098f792fb9f7ccb0d5a4e726c
diff --git a/snapshot/BUILD.gn b/snapshot/BUILD.gn
index b015819..fc2246a 100644
--- a/snapshot/BUILD.gn
+++ b/snapshot/BUILD.gn
@@ -444,7 +444,10 @@
   }
 
   if (crashpad_is_ios) {
-    deps += [ "../minidump" ]
+    deps += [
+      ":snapshot_test_ios_data",
+      "../minidump",
+    ]
   }
 
   data_deps = [
@@ -485,6 +488,14 @@
   }
 }
 
+bundle_data("snapshot_test_ios_data") {
+  testonly = true
+
+  sources = [ "ios/testdata/crash-1fa088dda0adb41459d063078a0f384a0bb8eefa" ]
+
+  outputs = [ "{{bundle_resources_dir}}/crashpad_test_data/" +
+              "{{source_root_relative_dir}}/{{source_file_part}}" ]
+}
 crashpad_loadable_module("crashpad_snapshot_test_module") {
   testonly = true
   sources = [ "crashpad_info_client_options_test_module.cc" ]
diff --git a/snapshot/ios/process_snapshot_ios_intermediate_dump.cc b/snapshot/ios/process_snapshot_ios_intermediate_dump.cc
index 7f02200..619ea95 100644
--- a/snapshot/ios/process_snapshot_ios_intermediate_dump.cc
+++ b/snapshot/ios/process_snapshot_ios_intermediate_dump.cc
@@ -77,9 +77,9 @@
   const IOSIntermediateDumpMap* thread_times =
       process_info->GetAsMap(Key::kTaskThreadTimes);
   if (thread_times) {
-    GetDataValueFromMap(basic_info, Key::kUserTime, &thread_times_user_time_);
+    GetDataValueFromMap(thread_times, Key::kUserTime, &thread_times_user_time_);
     GetDataValueFromMap(
-        basic_info, Key::kSystemTime, &thread_times_system_time_);
+        thread_times, Key::kSystemTime, &thread_times_system_time_);
   }
 
   GetDataValueFromMap(process_info, Key::kSnapshotTime, &snapshot_time_);
diff --git a/snapshot/ios/process_snapshot_ios_intermediate_dump_test.cc b/snapshot/ios/process_snapshot_ios_intermediate_dump_test.cc
index 1796c76..dc3ad27 100644
--- a/snapshot/ios/process_snapshot_ios_intermediate_dump_test.cc
+++ b/snapshot/ios/process_snapshot_ios_intermediate_dump_test.cc
@@ -25,6 +25,7 @@
 #include "minidump/minidump_file_writer.h"
 #include "test/errors.h"
 #include "test/scoped_temp_dir.h"
+#include "test/test_paths.h"
 #include "util/file/file_io.h"
 #include "util/file/filesystem.h"
 #include "util/file/string_file.h"
@@ -630,6 +631,15 @@
   ExpectSnapshot(process_snapshot);
 }
 
+TEST_F(ProcessSnapshotIOSIntermediateDumpTest, FuzzTestCases) {
+  base::FilePath fuzz_path = TestPaths::TestDataRoot().Append(FILE_PATH_LITERAL(
+      "snapshot/ios/testdata/crash-1fa088dda0adb41459d063078a0f384a0bb8eefa"));
+
+  crashpad::internal::ProcessSnapshotIOSIntermediateDump process_snapshot;
+  EXPECT_TRUE(process_snapshot.Initialize(fuzz_path, {}));
+  EXPECT_TRUE(LoggingRemoveFile(path()));
+}
+
 }  // namespace
 }  // namespace test
 }  // namespace crashpad
diff --git a/snapshot/ios/testdata/crash-1fa088dda0adb41459d063078a0f384a0bb8eefa b/snapshot/ios/testdata/crash-1fa088dda0adb41459d063078a0f384a0bb8eefa
new file mode 100644
index 0000000..6f062a7
--- /dev/null
+++ b/snapshot/ios/testdata/crash-1fa088dda0adb41459d063078a0f384a0bb8eefa
Binary files differ