fixed path walking (fixes 3164775)

git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@392 96b47cad-a561-4643-ad3b-153ac7d7599c
This commit is contained in:
frankmorgner
2011-01-24 15:30:11 +00:00
parent 90c2dc4cce
commit 2cd4899a42

View File

@@ -45,11 +45,11 @@ def walk(start, path): # {{{
if len(path) % 2 != 0: if len(path) % 2 != 0:
raise SwError(SW["ERR_INCORRECTPARAMETERS"]) raise SwError(SW["ERR_INCORRECTPARAMETERS"])
index = 0 index = 0
while index < len(path): while index + 2 < len(path):
if not isinstance(start, DF): if not isinstance(start, DF):
# File or application not found # File or application not found
raise SwError(SW["ERR_FILENOTFOUND"]) raise SwError(SW["ERR_FILENOTFOUND"])
start = start.select('fid', stringtoint(path[:2])) start = start.select('fid', stringtoint(path[index:index+2]))
index = index + 2 index = index + 2
return start return start