Prevent fix
authorSunwook Bae <sunwook45.bae@samsung.com>
Mon, 8 Apr 2013 01:45:33 +0000 (10:45 +0900)
committerSunwook Bae <sunwook45.bae@samsung.com>
Mon, 8 Apr 2013 01:45:33 +0000 (10:45 +0900)
Change-Id: I4022ac8e13ad4b32b2789858f9193945b3da37e2
Signed-off-by: Sunwook Bae <sunwook45.bae@samsung.com>
inc/FCntDownloadManager.h
src/FCnt_DownloadManagerImpl.cpp

index 2ea54b9..df974f3 100644 (file)
@@ -136,7 +136,7 @@ public:
        * @param[in]    request             The download request
        * @param[out]   reqId               The request ID
        * @exception    E_SUCCESS           The method is successful.
-       * @exception    E_INVALID_ARG           The URL of the download request is invalid.
+       * @exception    E_INVALID_ARG           The information of the download request is invalid.
        * @exception    E_ILLEGAL_ACCESS        Access to the path of the download request is denied due to insufficient permission.
        * @exception    E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
        * @exception    E_SYSTEM            The method cannot proceed due to a severe system error.
index 8bef6df..73dfb4f 100644 (file)
@@ -365,16 +365,20 @@ _DownloadManagerImpl::Start(const DownloadRequest& request, RequestId& reqId)
        //Add http headers
        IMap* pRequestHeader = _DownloadRequestImpl::GetInstance(&request)->GetRequestHeader();
        std::unique_ptr<IMapEnumerator> pMapEnume(const_cast< IMap* >(pRequestHeader)->GetMapEnumeratorN());
-        while (pMapEnume->MoveNext() == E_SUCCESS)
-        {
-                String* pMapKey = dynamic_cast<String*>(pMapEnume->GetKey());
-               unique_ptr<char[]> pKey(_StringConverter::CopyToCharArrayN(*pMapKey));
-                String* pMapValue = dynamic_cast<String*>(pMapEnume->GetValue());
-               unique_ptr<char[]> pValue(_StringConverter::CopyToCharArrayN(*pMapValue));
+       while (pMapEnume->MoveNext() == E_SUCCESS)
+       {
+               String* pMapKey = dynamic_cast<String*>(pMapEnume->GetKey());
+               String* pMapValue = dynamic_cast<String*>(pMapEnume->GetValue());
+               if (pMapKey && pMapValue)
+               {
+                       unique_ptr<char[]> pKey(_StringConverter::CopyToCharArrayN(*pMapKey));
+                       unique_ptr<char[]> pValue(_StringConverter::CopyToCharArrayN(*pMapValue));
 
-               ret = download_add_http_header_field(download_id, pKey.get(), pValue.get());
-               SysTryReturnResult(NID_CNT, ret >= 0, E_SYSTEM, "The internal system service is not available. %d", ret);
-        }
+                       ret = download_add_http_header_field(download_id, pKey.get(), pValue.get());
+                       SysTryReturnResult(NID_CNT, ret >= 0, E_SYSTEM, "The internal system service is not available. %d", ret);
+
+               }
+       }
 
        // Check the download path
        if (!dirPath.IsEmpty())