shamblett / cbor

A CBOR implementation for Dart
MIT License
36 stars 15 forks source link

Fixed negative small int CBOR de-serializing #64

Closed AlexDochioiu closed 2 weeks ago

AlexDochioiu commented 2 weeks ago

There is a bug where negative 33-bit ints (sign bit + 32-bit number) are serialized correctly but when reading the number, the value is truncated to 32-bits including the sign bit.

This effectively removes truncates one bit out of all 33-bit negative numbers (33-bit including sign bit)

P.s. you can run the added tests without the change and you'll see a few failing.

shamblett commented 2 weeks ago

Great thanks, well spotted.

Package re released at version 6.3.2