Skip to content

Commit ca5f93a

Browse files
committed
remove attack vector for large arrays
1 parent 6d16296 commit ca5f93a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/parse_schema.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,8 @@ fn parse_array_constraints(
418418
schema_obj: &Map<String, Value>,
419419
) -> Result<(usize, usize), ParseSchemaError> {
420420
let min_items = parse_optional_usize_field(schema_obj, "minItems")?.unwrap_or(0);
421-
let max_items = parse_optional_usize_field(schema_obj, "maxItems")?.unwrap_or(usize::MAX);
421+
let max_items =
422+
parse_optional_usize_field(schema_obj, "maxItems")?.unwrap_or(/* sane default */ 16);
422423
Ok((min_items, max_items))
423424
}
424425

0 commit comments

Comments
 (0)