Skip to content

Commit 2939b6b

Browse files
musicsnobjdwolfhub
authored andcommitted
handle zero-length password gracefully
1 parent 8459ce5 commit 2939b6b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

zxcvbn/scoring.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,10 @@ def make_bruteforce_match(i, j):
173173
# helper: step backwards through optimal.m starting at the end,
174174
# constructing the final optimal match sequence.
175175
def unwind(n):
176+
if n == 0:
177+
# return empty list for zero-length password
178+
return []
179+
176180
optimal_match_sequence = []
177181
k = n - 1
178182
# find the final best sequence length and score

0 commit comments

Comments
 (0)