Check key and value validity in PbMap (#1076)

Currently `PbMap` does not check ranges of values added as keys or values.

This allows serializing and deserializing a message with a map and getting a
different map back, because `PbMap` allows adding values that are out of range
(e.g. an integer larger than 32-bit range as a `sfixed32` value) but when
serializing it truncates the value.

Update `PbMap` to use the same validation functions as `PbList` when adding
elements. Both keys and values are checked.

Fixes #1065.
7 files changed
tree: 0c6c06f98551181f00a522b6f0565d0749731560
  1. .github/
  2. benchmarks/
  3. protobuf/
  4. protoc_plugin/
  5. tool/
  6. .gitignore
  7. analysis_options.yaml
  8. AUTHORS
  9. LICENSE
  10. pubspec.yaml
  11. README.md
README.md

Protobuf support for Dart

Protocol Buffers (protobuf) are Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data.

This repository is home to packages related to protobuf support for Dart.

PackageDescriptionPublished Version
protobufRuntime library for protocol buffers support.pub package
protoc_pluginA protobuf protoc compiler plugin used to generate Dart code.pub package
benchmarksBenchmarks for various protobuf functions.

Publishing automation

For information about our publishing automation and release process, see https://github.com/dart-lang/ecosystem/wiki/Publishing-automation.