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

Wrong NSRange calculations in [DBMatcher sequenceMatch] #1

Closed
tagyro opened this issue May 1, 2014 · 2 comments
Closed

Wrong NSRange calculations in [DBMatcher sequenceMatch] #1

tagyro opened this issue May 1, 2014 · 2 comments

Comments

@tagyro
Copy link

tagyro commented May 1, 2014

Steps to reproduce:

  • run demo app (after removing the code from AppDelegate)

  • enter text in password field, select all, delete, enter text

  • eventually the app will crash:

    *** Terminating app due to uncaught exception 'NSRangeException', reason: '-[__NSCFString substringWithRange:]: Range {11, 1} out of bounds; string length 11'
    *** First throw call stack:
    CoreFoundation 0x0000000101944bbd -[__NSCFString substringWithRange:] + 125
    Zxcvbn 0x0000000100009788 __26-[DBMatcher sequenceMatch]_block_invoke + 1816

@leah
Copy link
Collaborator

leah commented May 14, 2014

Hi @tagyro,

I'm unable to reproduce this issue. Are you entering any special characters? Are you using the simulator or a device?

The substringWithRange method is used all over the place in DBMatcher and DBScorer. Any clue where this error is occurring?

Thanks!

@tagyro
Copy link
Author

tagyro commented May 14, 2014

Hi @leah
I've been able to reproduce the crash consistently by following these steps:

  • run the demo (in the simulator or device, I've been able to reproduce it on both)
  • enter text in the password field
  • select text and delete or, without deleting, enter a new character
  • eventually the app will crash
    The crash log suggest the problem is in the sequenceMatch method in the DBMatcher.m file.

Note: if I just clone the repo and run the demo, the app crashes on launch because of the passwords array test in the AppDelegate.m. I commented out those lines to be able to run the app!
I've uploaded a video on Mega: https://mega.co.nz/#!BAtnTBIS!NmSiAC4XsMM3Z67XLr9VWEtEniMdbPrC_GOyYZ9dkCA

@leah leah closed this as completed in 12165e1 May 20, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants