Fixed encryption fail if file size is zero.
authorSoyoung Kim <sy037.kim@samsung.com>
Thu, 9 May 2013 05:24:34 +0000 (14:24 +0900)
committerSoyoung Kim <sy037.kim@samsung.com>
Thu, 9 May 2013 05:28:30 +0000 (14:28 +0900)
[Issue#] N/A
[Problem] web app installation failed when encryption setting is enable.
[Cause] try encryption at file size is zero.
[Solution] if file size is zero, skip encryption.
[SCMRequest] N/A

Change-Id: Icef14aac576d755f3d8b3afda5ed3b9e2aa398a8

src/jobs/widget_install/task_encrypt_resource.cpp

index 647817e..0b47580 100644 (file)
@@ -313,6 +313,10 @@ void TaskEncryptResource::EncryptFile(const std::string &fileName)
                 "[" << DPL::GetErrnoString(error) << "]");
     }
     const std::size_t fileSize = info.st_size;
+    if (0 == fileSize) {
+        LogDebug(fileName << " size is 0, so encryption is skiped");
+        return;
+    }
 
     DPL::ScopedFClose inFile(openFile(fileName, "r"));
     DPL::ScopedFClose outFile(openFile(encFile, "w"));