diff options
author | jmarshallnz <jcmarsha@gmail.com> | 2014-03-08 09:50:54 +1300 |
---|---|---|
committer | jmarshallnz <jcmarsha@gmail.com> | 2014-03-08 09:50:54 +1300 |
commit | 5c906c32e3ae410f0ce3c2825bf60a4d3018828b (patch) | |
tree | 55d07b3499ee1271ba2bcba40388a27655a1fa8e | |
parent | 9508ed3611da86138396b53999894300d5d7e988 (diff) | |
parent | ca3ffb176052b1e233d7d6f54f3c02d1dbb4da4c (diff) |
Merge pull request #4366 from Montellese/uriutils_resolvepath_fix
URIUtils: fix out of range exception in resolvePath()
-rw-r--r-- | xbmc/utils/URIUtils.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/xbmc/utils/URIUtils.cpp b/xbmc/utils/URIUtils.cpp index ea4ff97371..12dadbadac 100644 --- a/xbmc/utils/URIUtils.cpp +++ b/xbmc/utils/URIUtils.cpp @@ -1226,10 +1226,12 @@ std::string URIUtils::resolvePath(const std::string &path) CStdString realPath; int i = 0; // re-add any / or \ at the beginning - while (path.at(i) == delim.at(0)) + for (std::string::const_iterator itPath = path.begin(); itPath != path.end(); ++itPath) { + if (*itPath != delim.at(0)) + break; + realPath += delim; - i++; } // put together the path realPath += StringUtils::Join(realParts, delim); |