Skip to content

Commit af1d4b2

Browse files
use shallow copy for ranked dicts when user_inputs are present
1 parent 566fff1 commit af1d4b2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

zxcvbn/matching.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from . import adjacency_graphs
33
import re
44
import functools
5+
import copy
56

67
from zxcvbn.scoring import most_guessable_match_sequence
78

@@ -98,7 +99,8 @@ def wrapper(*args, **kwargs):
9899
# omnimatch -- perform all matches
99100
@ensure_ranked_dictionaries
100101
def omnimatch(password, _ranked_dictionaries=None, user_inputs=[]):
101-
if len(user_inputs):
102+
if _ranked_dictionaries is not None and user_inputs:
103+
_ranked_dictionaries = copy.copy(_ranked_dictionaries)
102104
_ranked_dictionaries['user_inputs'] = build_ranked_dict(user_inputs)
103105

104106
matches = []

0 commit comments

Comments
 (0)