avro-rs icon indicating copy to clipboard operation
avro-rs copied to clipboard

Union tags are cast unchecked

Open ghost opened this issue 5 years ago • 1 comments

Union tags are cast from i64 to usize when decoding without checking that the conversion makes sense. This has weird effects, such as on 32 bit platforms interpreting the tag 4294967300 as a 4. https://github.com/flavray/avro-rs/blob/7b820c13a1f25c7fd35850a6fed921aabc3ed103/src/decode.rs#L124

ghost avatar Mar 06 '19 17:03 ghost

This is fixed with

  1. https://github.com/flavray/avro-rs/commit/d719de228131a8978e230f8b404c5bf07ef89567
  2. https://github.com/flavray/avro-rs/commit/b3edfacced605a9d3229426441a2808176c86120#diff-aeece9508d349335fdebc30632ef26fa2851aa73336dea735c78d36cb7e77b2b

martin-g avatar Apr 20 '22 19:04 martin-g