Wait for download thread before destroying da_info 66/240966/5 accepted/tizen/unified/20200818.130009 submit/tizen/20200814.045951
authorSeonah Moon <seonah1.moon@samsung.com>
Thu, 13 Aug 2020 08:37:48 +0000 (17:37 +0900)
committerSeonah Moon <seonah1.moon@samsung.com>
Thu, 13 Aug 2020 09:09:17 +0000 (18:09 +0900)
commitf1d1309ff5fd4813d8bce2826409c926045d7ac0
tree1016a5503c7e6994e3f616e3baefdc8e5d600a44
parentceb50e9aef65c245a431efe5aa7aba072c450881
Wait for download thread before destroying da_info

A cancel request doesn't take effect immediately. (__http_gotheaders_cb)
So, below scenario can occur.

1. client-request thread requests cancel a download for a number of reasons. (ex. zombie client)
2. client-request thread is terminated.
3. queue-manager deallocates da_info_list for terminating.
4. download is canceled and then a http thread accesses to da_info for notifying download terminated.
5. heap-use-after-free occurs.

Change-Id: I47a7ef4c4d7ddda5f4594ee30885e3af230c6116
agent/download-agent-dl-info.c
agent/include/download-agent-dl-info.h
packaging/download-provider.spec