From d307d221955246524110f9118110b3fca8582738 Mon Sep 17 00:00:00 2001 From: Sude Date: Fri, 6 Aug 2021 11:25:54 +0300 Subject: [PATCH] Check for invalid path in GalaxyAPI::fileJsonNodeToGameFileVector Skip the file if we get invalid path for some reason. This should help with issue #200 (Crashes when downloading "secure") --- src/galaxyapi.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/galaxyapi.cpp b/src/galaxyapi.cpp index 0a0d119..dce8c1f 100644 --- a/src/galaxyapi.cpp +++ b/src/galaxyapi.cpp @@ -342,6 +342,12 @@ std::vector galaxyAPI::fileJsonNodeToGameFileVector(const std::string& std::string downlink_url = downlinkJson["downlink"].asString(); std::string path = this->getPathFromDownlinkUrl(downlink_url, gamename); + // Check to see if path ends in "/secure" which means that we got invalid path for some reason + boost::regex path_re("/secure$", boost::regex::perl | boost::regex::icase); + boost::match_results what; + if (boost::regex_search(path, what, path_re)) + continue; + gameFile gf; gf.gamename = gamename; gf.type = type;