diff options
authorLawrence Rust <>2011-07-28 13:26:11 (GMT)
committer Chris Pinkham <>2011-07-28 13:26:11 (GMT)
commitdb25a2885364d4d1b2198056f7a477f60cb395d6 (patch)
parent1e235ebb2724d347e12d752e0befa7f6773ad0e3 (diff)
Fix a potential segfault if MDM::downloadNow() times out.
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. Closes #9950 I'm leaving part 2 of #9950 uncommitted for now since we do not need or use this functionality internally. Signed-off-by: Chris Pinkham <>
1 files changed, 1 insertions, 0 deletions
diff --git a/mythtv/libs/libmythbase/mythdownloadmanager.cpp b/mythtv/libs/libmythbase/mythdownloadmanager.cpp
index 828ca5a..d28750f 100644
--- a/mythtv/libs/libmythbase/mythdownloadmanager.cpp
+++ b/mythtv/libs/libmythbase/mythdownloadmanager.cpp
@@ -665,6 +665,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_errorCode == QNetworkReply::NoError))