summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLawrence Rust <lvr@softsystem.co.uk>2011-07-28 13:26:11 (GMT)
committer Michael T. Dean <mdean@mythtv.org>2011-12-29 02:23:09 (GMT)
commitf7b28e57a9c5805befdf6538fb175124e0260ec2 (patch)
tree56f034bd49debd9a43c4a36bf44504bbc0d00233
parent40f3bae9f21e70ae77015682571338abc08eeaf1 (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. Refs #9950 Signed-off-by: Chris Pinkham <cpinkham@mythtv.org> (cherry picked from commit db25a2885364d4d1b2198056f7a477f60cb395d6)
-rw-r--r--mythtv/libs/libmythdb/mythdownloadmanager.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/mythtv/libs/libmythdb/mythdownloadmanager.cpp b/mythtv/libs/libmythdb/mythdownloadmanager.cpp
index 334df60..3db0400 100644
--- a/mythtv/libs/libmythdb/mythdownloadmanager.cpp
+++ b/mythtv/libs/libmythdb/mythdownloadmanager.cpp
@@ -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();