mirror of
https://github.com/protobuf-c/protobuf-c.git
synced 2024-12-26 04:31:03 +08:00
733ae77e23
From https://developers.google.com/protocol-buffers/docs/proto3#updating: int32, uint32, int64, uint64, and bool are all compatible – this means you can change a field from one of these types to another without breaking forwards- or backwards-compatibility. If a number is parsed from the wire which doesn't fit in the corresponding type, you will get the same effect as if you had cast the number to that type in C++ (e.g. if a 64-bit number is read as an int32, it will be truncated to 32 bits). Until this fix, protobuf-c did not conform to the rule above when it came to deserializing non-boolean packed repeated data into a protobuf_c_boolean array. Fully scan the varint and use parse_boolean to truncate the resulting value. Fixes #440