From fe88fd5a9c7726f8ec596c20fc78e44bead9c2e7 Mon Sep 17 00:00:00 2001 From: ksooo <3226626+ksooo@users.noreply.github.com> Date: Fri, 18 Oct 2024 08:08:20 +0200 Subject: [PVR] CAddonTimer: Fix memory corruption caused by freed string data transferred to add-on. --- xbmc/pvr/addons/PVRClient.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 m_customPropStringValues; std::unique_ptr m_customProps; }; -- cgit v1.2.3