Add null checking at AssignPackageTags 99/102099/3 accepted/tizen/3.0/common/20161206.125823 accepted/tizen/3.0/ivi/20161206.000414 accepted/tizen/3.0/mobile/20161206.000238 accepted/tizen/3.0/tv/20161206.000336 accepted/tizen/3.0/wearable/20161206.000354 submit/tizen_3.0/20161205.120256
authorSangyoon Jang <s89.jang@samsung.com>
Mon, 5 Dec 2016 04:19:28 +0000 (13:19 +0900)
committerSangyoon Jang <s89.jang@samsung.com>
Mon, 5 Dec 2016 11:41:14 +0000 (20:41 +0900)
Change-Id: I06b9b82e7ec3d02a05fce8a9be844a0bc8b36356
Signed-off-by: Sangyoon Jang <s89.jang@samsung.com>
src/common/pkgmgr_registration.cc

index 31b11ab..87595c5 100644 (file)
@@ -82,11 +82,14 @@ bool RegisterCertificates(
 // "readonly" : this package exists in readonly location.
 bool AssignPackageTags(manifest_x* manifest) {
   // preload, removalbe and readonly : in parse_preload step.
-  if (!strcmp(manifest->preload, "true"))
-    manifest->system = !strcmp(manifest->removable, "false") ?
-        strdup("true") : strdup("false");
-  else
+  if (manifest->preload && !strcmp(manifest->preload, "true")) {
+    if (manifest->removable && !strcmp(manifest->removable, "false"))
+      manifest->system = strdup("true");
+    else
+      manifest->system = strdup("false");
+  } else {
     manifest->system = strdup("false");
+  }
 
   return true;
 }