jefffhaynes / BinarySerializer

A declarative serialization framework for controlling formatting of data at the byte and bit level using field bindings, converters, and code.
MIT License
290 stars 62 forks source link

Restrict value of FieldBitLength member to stay within its assigned bit length #210

Closed bevanweiss closed 1 year ago

bevanweiss commented 1 year ago

Currently if a FieldBitLength attribute is applied which indicates <8 bits of data for a field, but it is defined of a type >=8 bits, it is possible to assign it a value which won't fit in the assigned bit length. This results in it overflowing to adjacent fields (only upwards in the byte). This can however cause 'corruption' in other fields.

Added:

Fixes #209

Signed-off-by: Bevan Weiss bevan.weiss@gmail.com