Fix comparing pkg certinfo API 27/255527/4
authorJunghyun Yeon <jungh.yeon@samsung.com>
Fri, 19 Mar 2021 04:26:12 +0000 (13:26 +0900)
committerJunghyun Yeon <jungh.yeon@samsung.com>
Fri, 19 Mar 2021 07:23:56 +0000 (07:23 +0000)
Change-Id: I87a428d75056cc71dfe98f806941dcafd2549130
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
src/manager/pkginfo_manager.cc

index c6472ee37ef3c12bf61b574170278f17c2804588..35c058013dee889571ca50342b459db5a86a88d6 100644 (file)
@@ -846,12 +846,13 @@ extern "C" EXPORT_API int _certinfo_compare_pkg_certinfo(const char* l_pkgid,
           ptr));
 
   auto certinfo_list = return_parcel->GetResult();
-  if (certinfo_list.size() != 2)
-    return PMINFO_R_ERROR;
 
   std::map<std::string, std::string> result_map;
+  result_map.insert(make_pair(std::string(l_pkgid), "-1"));
+  result_map.insert(make_pair(std::string(r_pkgid), "-1"));
+
   for (auto &certinfo : certinfo_list)
-    result_map.insert(make_pair(certinfo.front(), certinfo.back()));
+    result_map[certinfo.front()] = certinfo.back();
 
   if (result_map.find(std::string(l_pkgid))->second == "-1" &&
       result_map.find(std::string(r_pkgid))->second == "-1")