Skip to content

Fix array and opaque data impls

Martin Kröning requested to merge vla-impl into master

Closes #1 (closed). Closes #6 (closed).

I am not sure why this wasn't found in tests, but I think both impls for arrays are wrong:

  1. The FLA should not serialize its length according to the RFC.
  2. VLAs should encode their elements properly instead of just transmuting from its Rust repr (not only wrong but also unsound).
  3. VLA's lengths are measured in number of elements not number of bytes.

The padding to 4 bytes should be taken care of by the other primitives and their Xdr impl.

This introduces Xdr impls for opaque data ([u8; N] and Vec<u8>), which the array impls partly have been confused with.

Edited by Martin Kröning

Merge request reports