Closed FlixCoder closed 1 year ago
Great catch! This should be fixed by https://github.com/nomad/cola/commit/9f780e67cb7d47c6d54c5c57cfa93d9d6e6d1360.
Why don't you just let bincode encode and decode the whole tuple of fields?
Because I'm planning to rewrite the encoding logic to produce much smaller binaries.
Just browsed through the code and saw something: You are using usize to encode and decode the length of a byte array. The number of bytes differs on different architectures, so decoding would fail on a 32 bit system if it was sent from a 64 bit system.
Why don't you just let bincode encode and decode the whole tuple of fields? It saves code and should be safer. You also need to think about security here, as it is supposed to be sent over the wire.