3Hren / msgpack-rust

MessagePack implementation for Rust / msgpack.org[Rust]
MIT License
1.14k stars 130 forks source link

Fix SeqAccess and MapAccess unchecked unused length; float deserialize simplification #304

Closed Lucretiel closed 2 years ago

Lucretiel commented 2 years ago

Fixes #287: currently, the serde deserializer doesn't check the lengths of MapAccess or SeqAccess objects it sends to visit_seq and visit_map. This leads to a problem where certain kinds of input deserialize incorrectly. Added a fix for this bug, as well as a regression test demonstrating it.

Fixes #303: There's no reason to have a complex custom float deserializer when floats already successfully deserialize themselves from ints.

Additionally, made some obvious fixes suggested by cargo check and cargo clippy

kornelski commented 2 years ago

Thank you