Skip to content

Commit e8d2495

Browse files
fix: V-002 security vulnerability
Automated security fix generated by Orbis Security AI
1 parent 791deb4 commit e8d2495

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

backtracking/all_permutations.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,11 @@ def create_state_space_tree(
7878
remove the comment to take an input from the user
7979
8080
print("Enter the elements")
81-
sequence = list(map(int, input().split()))
81+
MAX_SEQUENCE_LENGTH = 8
82+
user_input = list(map(int, input().split()))
83+
if len(user_input) > MAX_SEQUENCE_LENGTH:
84+
raise ValueError(f"Input sequence too long (max {MAX_SEQUENCE_LENGTH} elements).")
85+
sequence = user_input
8286
"""
8387

8488
sequence: list[int | str] = [3, 1, 2, 4]

0 commit comments

Comments
 (0)