From: Soyoung Kim Date: Tue, 23 Apr 2013 09:00:58 +0000 (+0900) Subject: Fixed crash if encryption buffer is null X-Git-Tag: 2.1b_release^2~11 X-Git-Url: http://review.tizen.org/git/?p=framework%2Fweb%2Fwrt-installer.git;a=commitdiff_plain;h=bca1c0f24e8d20a25ada9bb080f5ddedc9ef6c71 Fixed crash if encryption buffer is null [Issue#] N/A [Problem] there is a crash when encryption resource. [Cause] no null check [Solution] check null from get buffer from trustzone. [SCMRequest] N/A --- diff --git a/src/jobs/widget_install/task_encrypt_resource.cpp b/src/jobs/widget_install/task_encrypt_resource.cpp index bca5665..647817e 100644 --- a/src/jobs/widget_install/task_encrypt_resource.cpp +++ b/src/jobs/widget_install/task_encrypt_resource.cpp @@ -347,6 +347,10 @@ void TaskEncryptResource::EncryptFile(const std::string &fileName) ByteBuffer *getBuffer = EncryptChunkByTrustZone( &appInfo, inChunk.get(), bytesRead); + if (getBuffer == NULL) { + ThrowMsg(Exceptions::EncryptionFailed, + "Encryption Failed using TrustZone"); + } int decBufSize = getBuffer->GetRemaining(); outChunk.reset(new unsigned char[decBufSize]);