Labels: Type-Defect Priority-Medium
New issue 234 by eschew: bool values not normalized before serialization
protobuf seems to assume that every bool value is representationally equal
to either true or false, rather than merely operationally equivalent.
If a bool with a bit-pattern that is not 0 or 1 is passed to a message
field's setter, serializing the message results in silent corruption of the
I don't know offhand to what degree the C++ standard constrains the
implementation of bools. It seems safe to classify this as a client
correctness issue, rather than a problem with protobuf itself. Still,
protobuf checks for other client problems such as trying to serialize
incomplete messages, so it might make sense for protobuf to perform
normalization of incoming bool values.
You received this message because you are subscribed to the Google Groups "Protocol
To post to this group, send email to proto...@googlegroups.com.
To unsubscribe from this group, send email to
For more options, visit this group at