Don't encrypt empty files because libwebappenc doesn't support it 63/53263/2 accepted/tizen/mobile/20151203.230802 accepted/tizen/tv/20151203.230817 accepted/tizen/wearable/20151203.230837 submit/tizen/20151203.083855
authorKamil Chłodnicki <k.chlodnicki@samsung.com>
Tue, 24 Nov 2015 13:09:53 +0000 (14:09 +0100)
committerPawel Sikorski <p.sikorski@samsung.com>
Thu, 3 Dec 2015 08:06:10 +0000 (00:06 -0800)
Change-Id: I78b0cd8ffd430527c2eeb6deabf97ce73ce10dce
Signed-off-by: Kamil Chłodnicki <k.chlodnicki@samsung.com>
src/wgt/step/step_encrypt_resources.cc

index 88db671..0f5041d 100644 (file)
@@ -112,6 +112,13 @@ bool StepEncryptResources::EncryptFile(const bf::path &src) {
   // read size
   fseek(input , 0 , SEEK_END);
   size_t length = ftell(input);
+
+  // don't encrypt empty files because libwebappenc doesn't support it
+  if (length == 0) {
+    fclose(input);
+    return true;
+  }
+
   rewind(input);
 
   char *input_buffer = new char[length];