Fix warning for rkp_factory_extraction_tool
The empty string was handled as a value. Also, the unit test that tested
this functionality was fixed.
Bug: 377389989
Test: atest system/security/provisioner
Test: m rkp_factory_extraction_tool
Test: adb push rkp_factory_extraction_tool /data
Test: adb shell adb shell /data/rkp_factory_extraction_tool
Test: The above command does not produce a warning.
Change-Id: Ifd12bb43956be00efce0b45656da6d65e19c02fa
diff --git a/provisioner/rkp_factory_extraction_lib.cpp b/provisioner/rkp_factory_extraction_lib.cpp
index d4aed45..a87aa40 100644
--- a/provisioner/rkp_factory_extraction_lib.cpp
+++ b/provisioner/rkp_factory_extraction_lib.cpp
@@ -261,7 +261,9 @@
while (ss.good()) {
std::string name;
std::getline(ss, name, ',');
- result.insert(name);
+ if (!name.empty()) {
+ result.insert(name);
+ }
}
return result;
}
\ No newline at end of file