Fix heap-use-after-free 92/244192/1 accepted/tizen_6.0_unified_hotfix tizen_6.0_hotfix accepted/tizen/6.0/unified/20201030.104928 accepted/tizen/6.0/unified/hotfix/20201103.000716 accepted/tizen/unified/20200917.055723 submit/tizen/20200917.013404 submit/tizen_6.0/20201029.205501 submit/tizen_6.0_hotfix/20201102.192901 submit/tizen_6.0_hotfix/20201103.115101 tizen_6.0.m2_release
authorSeonah Moon <seonah1.moon@samsung.com>
Wed, 16 Sep 2020 01:29:33 +0000 (10:29 +0900)
committerSeonah Moon <seonah1.moon@samsung.com>
Wed, 16 Sep 2020 01:29:42 +0000 (10:29 +0900)
In case of below scenario, da_info is freed immediately after cancel
request.

[client request thread]      [http thread]
1. download start
                           2. network doesn't work temporary
                           3. wait for auto retry (pthread_cond_timedwait(cond_http))
4. request cancel
                           5. pthread_cond_signal(cond_http)
                           6. free da_info
7. access to da_info for
   debugging message
   (fault)

Change-Id: I3bf0002e643af77dac17f69c543d29570c1f3cde

agent/download-agent-dl-mgr.c
packaging/download-provider.spec

index 0bce37595a0d802a8aceb280e111567a9d794042..14d1d0358179e8fe1d90706451b0999e3fbf6cfc 100755 (executable)
@@ -111,7 +111,7 @@ da_ret_t cancel_download(int dl_id, da_bool_t is_enable_cb)
        ret = request_to_cancel_http_download(da_info);
        if (ret != DA_RESULT_OK)
                goto ERR;
-       DA_LOGI("Download cancel Successful for download id[%d]", da_info->da_id);
+       DA_LOGI("Download cancel Successful for download id[%d]", dl_id);
 
 ERR:
        return ret;
index 6bae5f40a06f01fe8ac19d93975120cb8147e3c8..d4daee4d55c639c28a48d94e0f555d175925fc4a 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       download-provider
 Summary:    Download the contents in background
-Version:    2.2.1
+Version:    2.2.2
 Release:    0
 Group:      Development/Libraries
 License:    Apache-2.0