From a20bd74949e812d769cb3b231ecf1bd4a4810bc7 Mon Sep 17 00:00:00 2001 From: Daniel Scheller Date: Thu, 14 Nov 2013 22:18:26 +0100 Subject: [PATCH] fix: CScraper: check for TiXmlElement NULL return to not pass NULL to StringUtils::EqualsNoCase(), fixes SIGSEGV crash --- xbmc/addons/Scraper.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xbmc/addons/Scraper.cpp b/xbmc/addons/Scraper.cpp index ab6b11e8f7ad0..b4684bcdd1c9e 100644 --- a/xbmc/addons/Scraper.cpp +++ b/xbmc/addons/Scraper.cpp @@ -618,7 +618,11 @@ std::vector CScraper::FindMovie(XFILE::CCurlFile &fcurl, const CStd // we need to sort if returned results don't specify 'sorted="yes"' if (fSort) - fSort = !StringUtils::EqualsNoCase(xhResults.Element()->Attribute("sorted"), "yes"); + { + const char *sorted = xhResults.Element()->Attribute("sorted"); + if (sorted != NULL) + fSort = !StringUtils::EqualsNoCase(sorted, "yes"); + } for (TiXmlElement *pxeMovie = xhResults.FirstChild("entity").Element(); pxeMovie; pxeMovie = pxeMovie->NextSiblingElement())