Skip to content

Releases: mapbox/protozero

Version 1.6.0

24 Oct 13:13
Compare
Choose a tag to compare

Added

  • Comparison functions (<, <=, >, >=) for data_view. Allows use in std::map for instance.
  • Tool pbf-decoder for decoding raw messages. This has limited use for normal users, but it can be used for fuzzing.

Changed

  • Protozero now uses CMake to build the tests etc. This does not affect simple users of the library, but if you are using CMake yourself you might want to use the cmake/FindProtozero.cmake module provided. The README contains more information about build options.
  • Moved data_view class from types.hpp into its own header file data_view.hpp.
  • Implementation of the const_fixed_iterator to use only a single pointer instead of two.
  • Made operator== and operator!= on data_view constexpr.
  • The pbf_reader constructor taking a std::pair is deprecated. Use one of the other constructors instead.

Fixed

  • Varints where the last byte was larger than what would fit in 64bit were triggering undefined behaviour. This can only happen when the message being decoded was corrupt in some way.
  • Do not assert when reading too long varints for bools any more. A valid encoder should never generate varints with more than one byte for bools, but if they are longer that's not really a problem, so just handle it.
  • Throw exception if the length of a packed repeated field of a fixed-length type is invalid. The length must always be a multiple of the size of the underlying type. This can only happen if the data is corrupted in some way, a valid encoder would never generate data like this.
  • Throw an exception when reading invalid tags. This can only happen if the data is corrupted in some way, a valid encoder would never generate invalid tags.

Version 1.5.3

22 Sep 12:35
Compare
Choose a tag to compare

Added

  • More documentation.
  • New size() method on iterator range used for packed repeated fields to find out how many elements there are in the range. This is much faster compared to the std::difference() call you had to do before, because the varints don't have to be fully decoded. See Advanced Topics for details.

Changed

  • Updated clang-tidy settings in Makefiles and fixed a lot of minor issues reported by clang-tidy.
  • Update included catch.hpp to version 1.10.0.
  • Miscellaneous code cleanups.
  • Support for invalid state in pbf_writer and packed_repeated_fields. This fixes move construction and move assignement in pbf_writer and disables the copy construction and copy assignement which don't have clear semantics. It introduces an invalid or empty state in the pbf_writer, pbf_builder, and packed_repeated_fields classes used for default-constructed, moved from, or committed objects. There is a new commit() function for pbf_writer and the packed_repeated_fields which basically does the same as the destructor but can be called explicitly.

Fixed

  • The empty() method of the iterator range now returns a bool instead of a size_t.

Version 1.5.2

30 Jun 13:40
Compare
Choose a tag to compare

Added

  • Add missing two-parameter version of pbf_message::next() function.
  • Add data_view::empty() function.
  • Add missing versions of add_bytes(), add_string(), and add_message()
    to pbf_builder.

Changed

  • Clarify include file usage in tutorial.
  • Updated included Catch unit test framework to version 1.9.6 and updated tests to work with the current version.
  • Make some constructors explicit (best practice to avoid silent conversions).

Fixed

  • Important bugfix in data_view equality operator. The equality operator is actually never used in the protozero code itself, but users of protozero might use it. This is a serious bug that could lead to buffer overrun type problems.

Version 1.5.1

14 Jan 08:42
Compare
Choose a tag to compare

Added

  • Better documentation for tag_and_type() in doc/advanced.md.

Fixed

  • Fixed broken "make doc" build.

Version 1.5.0

12 Jan 09:01
Compare
Choose a tag to compare

Added

  • Add add_bytes_vectored() methods to pbf_writer and pbf_builder. This
    allows single-copy scatter-gather type adding of data that has been prepared
    in pieces to a protobuf message.
  • New functions to check the tag and wire type at the same time: Two parameter
    version of pbf_reader::next() and pbf_reader::tag_and_type() can be used
    together with the free function tag_and_type() to easily and quickly check
    that not only the tag but also the wire type is correct for a field.

Changed

  • packed_field_* classes now work with pbf_builder.
  • Reorganized documentation. Advanced docs are now under doc/advanced.md.

Fixed

  • packed_field class is now non-copyable because data can get corrupted if
    you copy it around.
  • Comparison operators of data_view now have const& parameters.
  • Make zigzag encoding/decoding functions constexpr.

Version 1.4.5

18 Nov 14:43
Compare
Choose a tag to compare

Fixed

  • Undefined behaviour in packed fixed iterator. As a result, the macro
    PROTOZERO_DO_NOT_USE_BARE_POINTER is not used any more.

Version 1.4.4

15 Nov 21:07
Compare
Choose a tag to compare

Fixed

  • Byteswap implementation.

Version 1.4.3

15 Nov 12:47
Compare
Choose a tag to compare

Fixed

  • Undefined behaviour in byte swapping code.
  • Rename some parameters to avoid "shadow" warning from some compilers.

Version 1.4.2

27 Aug 07:34
Compare
Choose a tag to compare

Fixed

  • Compile fix: Variable shadowing.

Version 1.4.1

24 Aug 10:07
Compare
Choose a tag to compare

Fixed

  • GCC 4.8 compile fixed

Added

  • New ability to dynamically require the module as a node module to ease building against from other node C++ modules.