Skip to content

Commit

Permalink
fix: CScraper: check for TiXmlElement NULL return to not pass NULL to…
Browse files Browse the repository at this point in the history
… StringUtils::EqualsNoCase(), fixes SIGSEGV crash
  • Loading branch information
herrnst committed Nov 14, 2013
1 parent 898b37e commit a20bd74
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion xbmc/addons/Scraper.cpp
Expand Up @@ -618,7 +618,11 @@ std::vector<CScraperUrl> CScraper::FindMovie(XFILE::CCurlFile &fcurl, const CStd


// we need to sort if returned results don't specify 'sorted="yes"' // we need to sort if returned results don't specify 'sorted="yes"'
if (fSort) 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(); for (TiXmlElement *pxeMovie = xhResults.FirstChild("entity").Element();
pxeMovie; pxeMovie = pxeMovie->NextSiblingElement()) pxeMovie; pxeMovie = pxeMovie->NextSiblingElement())
Expand Down

0 comments on commit a20bd74

Please sign in to comment.