From: Eunki Hong Date: Sun, 27 Nov 2022 07:12:00 +0000 (+0900) Subject: Fix svace issue (file-download writter null check) X-Git-Tag: dali_2.2.4~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d9a166bd103483d1e1e0d9a4e5f443340b6a5806;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git Fix svace issue (file-download writter null check) Change-Id: I35729eb2d6cc647eedb953fc7d9aaf70c3ae84a7 Signed-off-by: Eunki Hong --- diff --git a/dali/internal/imaging/common/file-download.cpp b/dali/internal/imaging/common/file-download.cpp index 278375d..2940300 100644 --- a/dali/internal/imaging/common/file-download.cpp +++ b/dali/internal/imaging/common/file-download.cpp @@ -121,10 +121,11 @@ CURLcode DownloadFileDataWithSize(CURL* curlHandle, Dali::Vector& dataB // create Dali::Internal::Platform::FileWriter fileWriter(dataBuffer, dataSize); FILE* dataBufferFilePointer = fileWriter.GetFile(); - setbuf(dataBufferFilePointer, NULL); // Turn buffering off if(NULL != dataBufferFilePointer) { + setbuf(dataBufferFilePointer, NULL); // Turn buffering off + // we only want the body which contains the file data curl_easy_setopt(curlHandle, CURLOPT_HEADER, EXCLUDE_HEADER); curl_easy_setopt(curlHandle, CURLOPT_NOBODY, INCLUDE_BODY); @@ -136,6 +137,12 @@ CURLcode DownloadFileDataWithSize(CURL* curlHandle, Dali::Vector& dataB // synchronous request of the body data result = curl_easy_perform(curlHandle); } + else + { + DALI_LOG_ERROR("Fail to open buffer writter with size : %zu!\n", dataSize); + // @todo : Need to check that is it correct error code? + result = CURLE_READ_ERROR; + } return result; }