mirror of
https://github.com/protocolbuffers/protobuf-go.git
synced 2025-01-26 09:35:33 +00:00
e1c61a307e
For historical reasons, MessageSets items are allowed to have field numbers outside the usual valid range. Detect the case where the field number cannot fit in an int32 and report an error. Also check for a field number of 0 (always invalid). Handle the case where a MessageSet item includes an unknown field. We have no place to put the contents of the field, so drop it. This is, I believe, consistent with other implementations. Change-Id: Ic403427e1c276cbfa232ca577e7a799cce706bc7 Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/221939 Reviewed-by: Herbie Ong <herbie@google.com>