Fix crash during mount update recovery 61/168261/1
authorSangyoon Jang <jeremy.jang@samsung.com>
Tue, 23 Jan 2018 08:21:33 +0000 (17:21 +0900)
committerSangyoon Jang <jeremy.jang@samsung.com>
Thu, 25 Jan 2018 08:24:14 +0000 (17:24 +0900)
Change-Id: I51a51404c022f64c965dd98b97c67ce918044fe0
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
src/common/step/mount/step_mount_recover.cc

index 4012357..8eb7246 100644 (file)
@@ -7,6 +7,8 @@
 #include <boost/filesystem/path.hpp>
 #include <boost/filesystem/operations.hpp>
 
+#include <pkgmgrinfo_basic.h>
+
 #include "common/paths.h"
 #include "common/tzip_interface.h"
 
@@ -18,8 +20,9 @@ namespace mount {
 Step::Status StepMountRecover::RecoveryMountUpdate() {
   bf::path zip_destination_path =
       GetZipPackageLocation(context_->pkg_path.get(), context_->pkgid.get());
-  context_->manifest_data.get()->zip_mount_file =
-      strdup(zip_destination_path.c_str());
+  manifest_x* manifest = context_->manifest_data.get();
+  if (manifest)
+    manifest->zip_mount_file = strdup(zip_destination_path.c_str());
 
   bf::path mount_point = GetMountLocation(context_->pkg_path.get());
   TzipInterface tzip_final(mount_point);