Skip to content

Commit

Permalink
fix: Array length check
Browse files Browse the repository at this point in the history
  • Loading branch information
timokoessler committed Dec 9, 2024
1 parent 275f247 commit 61b4a8b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion library/helpers/attackPath.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ t.test("respects max depth and array length", async (t) => {
".prop".repeat(30),
]);

const testArr = Array.from({ length: 101 }, (_, i) => i.toString());
const testArr = Array.from({ length: 150 }, (_, i) => i.toString());

t.same(get("50", testArr), [".[50]"]);
t.same(get("99", testArr), [".[99]"]);
Expand Down
2 changes: 1 addition & 1 deletion library/helpers/attackPath.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export function getPathsToPayload(
if (index > MAX_ARRAY_LENGTH) {
break;
}
traverse(item, path.concat({ type: "array", index }), depth + 1);
traverse(item, path.concat({ type: "array", index }), depth);
}

if (value.join().toLowerCase() === attackPayloadLowercase) {
Expand Down

0 comments on commit 61b4a8b

Please sign in to comment.