Skip to content

Commit

Permalink
Fix a potential segfault if MDM::downloadNow() times out.
Browse files Browse the repository at this point in the history
Reset the destination QByteArray pointer after a download
timeout to make sure the downloadFinished() callback doesn't
try to write to it after it has been deallocated.

Refs #9950

Signed-off-by: Chris Pinkham <cpinkham@mythtv.org>
(cherry picked from commit db25a28)
  • Loading branch information
Lawrence Rust authored and sphery committed Dec 29, 2011
1 parent 40f3bae commit f7b28e5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions mythtv/libs/libmythdb/mythdownloadmanager.cpp
Expand Up @@ -651,6 +651,7 @@ bool MythDownloadManager::downloadNow(MythDownloadInfo *dlInfo, bool deleteInfo)

if (!dlInfo->m_done)
{
dlInfo->m_data = NULL; // Prevent downloadFinished() from updating
dlInfo->m_syncMode = false; // Let downloadFinished() cleanup for us
if (dlInfo->m_reply)
dlInfo->m_reply->abort();
Expand Down

0 comments on commit f7b28e5

Please sign in to comment.