Skip to content

Commit

Permalink
Add missing recursion limit check for tuples
Browse files Browse the repository at this point in the history
Signed-off-by: Emanuele Giaquinta <[email protected]>
  • Loading branch information
exg committed Apr 17, 2024
1 parent ffcbc27 commit e01657b
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions src/serialize/serializer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,14 +232,19 @@ impl Serialize for PyObject {
)
.serialize(serializer)
}
ObType::Tuple => Tuple::new(
self.ptr,
self.opts,
self.default_calls,
self.recursion,
self.default,
)
.serialize(serializer),
ObType::Tuple => {
if unlikely!(self.recursion == RECURSION_LIMIT) {
err!(RECURSION_LIMIT_REACHED)
}
Tuple::new(
self.ptr,
self.opts,
self.default_calls,
self.recursion,
self.default,
)
.serialize(serializer)
}
ObType::Dataclass => {
if unlikely!(self.recursion == RECURSION_LIMIT) {
err!(RECURSION_LIMIT_REACHED)
Expand Down

0 comments on commit e01657b

Please sign in to comment.