aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Sommerfeld <3226626+ksooo@users.noreply.github.com>2024-10-19 09:10:40 +0200
committerGitHub <noreply@github.com>2024-10-19 09:10:40 +0200
commitad51569897c335f0183e7567457e8824047bb22e (patch)
tree9618b5fb2464b5b64f913209965b23827808ec5b
parent772840f3d58236d2ea15fd1246d322c3c71f0ca5 (diff)
parentfe88fd5a9c7726f8ec596c20fc78e44bead9c2e7 (diff)
Merge pull request #25847 from ksooo/pvr-fix-custom-string-props
[PVR] CAddonTimer: Fix memory corruption caused by freed string data transferred to add-on.
-rw-r--r--xbmc/pvr/addons/PVRClient.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/xbmc/pvr/addons/PVRClient.cpp b/xbmc/pvr/addons/PVRClient.cpp
index 8d56392567..4e1fca84b9 100644
--- a/xbmc/pvr/addons/PVRClient.cpp
+++ b/xbmc/pvr/addons/PVRClient.cpp
@@ -269,7 +269,8 @@ public:
prop.iKey = entry.first;
prop.eType = entry.second.type;
prop.iValue = entry.second.value.asInteger32();
- prop.strValue = entry.second.value.asString().c_str();
+ m_customPropStringValues.emplace_back(entry.second.value.asString());
+ prop.strValue = m_customPropStringValues.back().c_str();
++idx;
}
customProps = m_customProps.get();
@@ -283,6 +284,7 @@ private:
const std::string m_directory;
const std::string m_summary;
const std::string m_seriesLink;
+ std::vector<std::string> m_customPropStringValues;
std::unique_ptr<PVR_SETTING_KEY_VALUE_PAIR[]> m_customProps;
};