Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NSRangeException index 0 beyond bounds for SessionWindow #13

Open
brodjieski opened this issue Mar 20, 2014 · 2 comments
Open

NSRangeException index 0 beyond bounds for SessionWindow #13

brodjieski opened this issue Mar 20, 2014 · 2 comments
Labels

Comments

@brodjieski
Copy link

When running OSXAuditor on a system in which a user does not have any saved Session data from Safari, an error is generated. The error is:

IndexError: NSRangeException - -[__NSCFArray objectAtIndex:]: index (0) beyond bounds (0)

The contents of the LastSession.plist are:

{
SessionVersion = "1.0";
SessionWindows = (
);
}

From what I can gather, this section (line 713) is not validating there are objects within the SessionWindows key of the plist.

if "SessionWindows" in LastSessionPlist:
    LastSession = LastSessionPlist["SessionWindows"][0]["TabStates"][0]
    PrintAndLog(LastSession["TabURL"].decode("utf-8") + u" - " + binascii.hexlify(LastSession["SessionState"]).decode("hex").decode("utf-8", "ignore"), "INFO")

Once I open some tabs in Safari and quit, the LastSession.plist file contains data in the SessionWindows key, and the osxauditor.py script runs without issue.

@ActionScripted
Copy link

Had the same error and this fixed things if that helps in any way. Perhaps check the length of SessionWindows?

@jipegit
Copy link
Owner

jipegit commented Oct 31, 2015

Can't reproduce.

@jipegit jipegit added the bug label Nov 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants