Permalink
Browse files

fix: CScraper: check for TiXmlElement NULL return to not pass NULL to…

… StringUtils::EqualsNoCase(), fixes SIGSEGV crash
  • Loading branch information...
1 parent 898b37e commit a20bd74949e812d769cb3b231ecf1bd4a4810bc7 @herrnst herrnst committed Nov 14, 2013
Showing with 5 additions and 1 deletion.
  1. +5 −1 xbmc/addons/Scraper.cpp
View
6 xbmc/addons/Scraper.cpp
@@ -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"'
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())

0 comments on commit a20bd74

Please sign in to comment.