You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix map decoding when key or value fields are missing (#745)
Map fields are encoded as repeated message fields where the message
field 1 is the key and 2 is the value.
In proto syntax, a map field like
map<int32, MyMessage> map_field = 1;
is encoded as if it was
repeated MapFieldEntry map_field = 1;
where
message MapFieldEntry {
optional int32 key = 1;
optional MyMessage value = 2;
}
Since map entries are ordinary messages, it's possible for a map entry
to have no key or value fields.
This PR updates map decoding to handle missing key and value fields.
Three tests added for (1) missing key field (2) missing value field (3)
missing key and value fields (entry message has 0 length prefix).
Fixes#719
0 commit comments