Skip to content

Commit

Permalink
Fix bug in fuzzer with deny_unknown_fields structs inside flatten (#517)
Browse files Browse the repository at this point in the history
  • Loading branch information
juntyr committed Oct 14, 2023
1 parent a6fc5eb commit e27d1d5
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions fuzz/fuzz_targets/bench/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1750,6 +1750,10 @@ impl<'a, 'de> DeserializeSeed<'de> for BorrowedTypedSerdeData<'a> {
));
};
}
// flattened structs are incompatible with strict fields
while map.next_key::<serde::de::IgnoredAny>()?.is_some() {
map.next_value::<serde::de::IgnoredAny>().map(|_| ())?;
}
Ok(())
}
}
Expand Down Expand Up @@ -2197,6 +2201,11 @@ impl<'a, 'de> DeserializeSeed<'de> for BorrowedTypedSerdeData<'a> {
));
};
}
// flattened struct variants are incompatible with strict fields
while map.next_key::<serde::de::IgnoredAny>()?.is_some() {
map.next_value::<serde::de::IgnoredAny>()
.map(|_| ())?;
}
Ok(())
}
}
Expand Down Expand Up @@ -3721,6 +3730,10 @@ impl<'a, 'de> DeserializeSeed<'de> for BorrowedTypedSerdeData<'a> {
));
};
}
// flattened struct variants are incompatible with strict fields
while map.next_key::<serde::de::IgnoredAny>()?.is_some() {
map.next_value::<serde::de::IgnoredAny>().map(|_| ())?;
}
Ok(())
}
}
Expand Down

0 comments on commit e27d1d5

Please sign in to comment.