From bfaf9d0d6d55a4e007bbdc1172c76e89a0fb92e2 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Wed, 3 Apr 2013 00:18:51 -0700 Subject: [PATCH] Clean up restricted ISO reading. --- Core/FileSystems/ISOFileSystem.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Core/FileSystems/ISOFileSystem.cpp b/Core/FileSystems/ISOFileSystem.cpp index 2e3363a7e9..e88e7ac40f 100644 --- a/Core/FileSystems/ISOFileSystem.cpp +++ b/Core/FileSystems/ISOFileSystem.cpp @@ -141,8 +141,10 @@ ISOFileSystem::ISOFileSystem(IHandleAllocator *_hAlloc, BlockDevice *_blockDevic while (pos != _restrictPath.npos) { size_t endPos = _restrictPath.find_first_of('/', pos); + if (endPos == _restrictPath.npos) + endPos = _restrictPath.length(); if (pos != endPos) - restrictTree.push_back(_restrictPath.substr(pos, endPos)); + restrictTree.push_back(_restrictPath.substr(pos, endPos - pos)); pos = _restrictPath.find_first_not_of('/', endPos); } }