trichards57 / zxcvbn-cs

C#/.NET port of Dan Wheeler/DropBox's Zxcvbn JS password strength estimation library
MIT License
59 stars 18 forks source link

crash when empty password #30

Closed tmijieux closed 2 years ago

tmijieux commented 3 years ago

https://github.com/trichards57/zxcvbn-cs/blob/8e0ace4be47fc241766acb742fe977a6c666abde/zxcvbn-core/PasswordScoring.cs#L194

reproducing the issue: When calling EvaluatePassword with an empty string

observed behavior: the code will throw here because k = -1 from the beginning

the behaviour i would expect: no crash because out of bound access , I would expect that the EvaluatePassword function return normally and give the default feedback with score of 0