diff options
author | Ryan Mitchell <rtmitchell@google.com> | 2020-03-23 17:11:22 -0700 |
---|---|---|
committer | Ryan Mitchell <rtmitchell@google.com> | 2020-03-24 01:02:38 +0000 |
commit | a7b7de59e0a9e880cc7b5dcd4f2693825b9f3e25 (patch) | |
tree | bd4e98d6b550d196c513c362640d0b7d8844d3ca /cmds/idmap2 | |
parent | 32f87fc6fbd1c707233cd355bbfe61af6bfcf484 (diff) |
Fix idmap2 uninitialized variables
Some primitives were not initialized to a default value causing
--ignore-overlayable and --verbose to default to true.
Bug: 148181123
Test: idmap2_tests
Change-Id: If87ba76b7d24803f46b71ef36befa12f25916680
Merged-In: Ic9dbd3e9a768beb39ac677ff294b0fca5ee8f9d2
Diffstat (limited to 'cmds/idmap2')
-rw-r--r-- | cmds/idmap2/idmap2/Create.cpp | 2 | ||||
-rw-r--r-- | cmds/idmap2/idmap2/Dump.cpp | 2 | ||||
-rw-r--r-- | cmds/idmap2/tests/Idmap2BinaryTests.cpp | 1 |
3 files changed, 2 insertions, 3 deletions
diff --git a/cmds/idmap2/idmap2/Create.cpp b/cmds/idmap2/idmap2/Create.cpp index bb8d92737563..f482191b09a8 100644 --- a/cmds/idmap2/idmap2/Create.cpp +++ b/cmds/idmap2/idmap2/Create.cpp @@ -50,7 +50,7 @@ Result<Unit> Create(const std::vector<std::string>& args) { std::string overlay_apk_path; std::string idmap_path; std::vector<std::string> policies; - bool ignore_overlayable; + bool ignore_overlayable = false; const CommandLineOptions opts = CommandLineOptions("idmap2 create") diff --git a/cmds/idmap2/idmap2/Dump.cpp b/cmds/idmap2/idmap2/Dump.cpp index 8716bf313ed0..47f442aab235 100644 --- a/cmds/idmap2/idmap2/Dump.cpp +++ b/cmds/idmap2/idmap2/Dump.cpp @@ -39,7 +39,7 @@ using android::idmap2::Unit; Result<Unit> Dump(const std::vector<std::string>& args) { SYSTRACE << "Dump " << args; std::string idmap_path; - bool verbose; + bool verbose = false; const CommandLineOptions opts = CommandLineOptions("idmap2 dump") diff --git a/cmds/idmap2/tests/Idmap2BinaryTests.cpp b/cmds/idmap2/tests/Idmap2BinaryTests.cpp index 8a48f4b8e6d5..499eb99af290 100644 --- a/cmds/idmap2/tests/Idmap2BinaryTests.cpp +++ b/cmds/idmap2/tests/Idmap2BinaryTests.cpp @@ -131,7 +131,6 @@ TEST_F(Idmap2BinaryTests, Dump) { ASSERT_NE(result->stdout.find("0x7f02000c -> 0x7f020000 string/str1"), std::string::npos); ASSERT_NE(result->stdout.find("0x7f02000e -> 0x7f020001 string/str3"), std::string::npos); ASSERT_NE(result->stdout.find("0x7f02000f -> 0x7f020002 string/str4"), std::string::npos); - ASSERT_EQ(result->stdout.find("00000210: 007f target package id"), std::string::npos); // clang-format off result = ExecuteBinary({"idmap2", |