Petteri Aimonen [Fri, 14 Apr 2017 08:46:18 +0000 (11:46 +0300)]
Fix bugs in proto3 mode encoding of submessages (#256)
pb_check_proto3_default_value() recurses into submessages,
but it didn't handle other than singular fields correctly.
This caused it to sometimes skip submessages with only
repeated or oneof fields present.
Petteri Aimonen [Fri, 14 Apr 2017 08:45:57 +0000 (11:45 +0300)]
Add testcase for issue #256
Petteri Aimonen [Tue, 28 Mar 2017 20:21:43 +0000 (23:21 +0300)]
Merge branch 'master' of github.com:nanopb/nanopb
Petteri Aimonen [Tue, 28 Mar 2017 20:20:31 +0000 (23:20 +0300)]
Fix message length calculation for arrays of size 1 (issue #253)
Petteri Aimonen [Tue, 28 Mar 2017 20:20:16 +0000 (23:20 +0300)]
Add regression test for issue #253
Petteri Aimonen [Thu, 16 Mar 2017 14:48:26 +0000 (16:48 +0200)]
Merge pull request #250 from conz27/master
CMAKE: remove use of relative paths
Petteri Aimonen [Sun, 12 Mar 2017 10:18:32 +0000 (12:18 +0200)]
Fix potential out-of-bounds read with more than 64 required fields
Petteri Aimonen [Sun, 12 Mar 2017 09:44:24 +0000 (11:44 +0200)]
Improve varint unittest coverage for error cases
Constantine Grantcharov [Sun, 5 Mar 2017 18:02:43 +0000 (13:02 -0500)]
Fixing install issue due to relative paths
Constantine Grantcharov [Sun, 5 Mar 2017 17:29:09 +0000 (12:29 -0500)]
Remove use of relative paths
When doing out of source builds:
mkdir build
cd build && cmake -G "Unix Makefiles" ../ && make
The build script tripped up on relative paths of /generator/proto and
the files under generator/proto/*.proto.
By using ${PROJECT_SOURCE_DIR}, the paths become absolute and the issue
disappears.
Petteri Aimonen [Sun, 5 Mar 2017 16:40:43 +0000 (18:40 +0200)]
Forgot to fill in the dates
Petteri Aimonen [Sun, 5 Mar 2017 16:39:40 +0000 (18:39 +0200)]
Setting version to 0.3.9-dev
Petteri Aimonen [Sun, 5 Mar 2017 16:28:23 +0000 (18:28 +0200)]
Publishing nanopb-0.3.8
Petteri Aimonen [Sun, 5 Mar 2017 16:27:44 +0000 (18:27 +0200)]
Update changelog
Petteri Aimonen [Thu, 2 Mar 2017 20:40:15 +0000 (22:40 +0200)]
Fix alltypes_callback testcase
The test case was erroneously comparing whole submsg structures,
which could result in false errors when padding bytes differed.
Petteri Aimonen [Thu, 2 Mar 2017 20:14:00 +0000 (22:14 +0200)]
Fix callback pointer corruption in proto3 mode (issue #249)
Petteri Aimonen [Thu, 2 Mar 2017 20:04:02 +0000 (22:04 +0200)]
Add regression test for issue #249
Petteri Aimonen [Thu, 2 Mar 2017 20:03:50 +0000 (22:03 +0200)]
Add callback test for proto3 mode
Petteri Aimonen [Thu, 2 Mar 2017 19:51:31 +0000 (21:51 +0200)]
Fix bug in alltypes_callback test case
Petteri Aimonen [Sun, 26 Feb 2017 08:13:38 +0000 (10:13 +0200)]
Update changelog
Petteri Aimonen [Sat, 25 Feb 2017 19:47:24 +0000 (21:47 +0200)]
Fix build failure (const_cast name conflict)
Thought I was cleaning up the naming by calling the function const_cast(),
because that's what it does. But of course it conflicts with the C++ builtin,
so renaming it to pb_const_cast() now.
Petteri Aimonen [Sat, 25 Feb 2017 19:44:52 +0000 (21:44 +0200)]
Add transitional options.proto file (#241)
Petteri Aimonen [Sat, 25 Feb 2017 19:31:06 +0000 (21:31 +0200)]
Add better error message on Python library version imcompatibility (issue #240)
Petteri Aimonen [Sat, 25 Feb 2017 19:23:10 +0000 (21:23 +0200)]
Make pb_check_proto3_default_value() recurse into submessages (issue #247)
Petteri Aimonen [Sat, 25 Feb 2017 19:22:41 +0000 (21:22 +0200)]
Add testcase for issue #247
Petteri Aimonen [Sat, 25 Feb 2017 15:14:39 +0000 (17:14 +0200)]
Windows build fix
Petteri Aimonen [Sat, 25 Feb 2017 08:49:30 +0000 (10:49 +0200)]
Merge pull request #245 from jdemar/master
Fix infinite loop in pb_check_proto3_default_value
Justin DeMartino [Sat, 25 Feb 2017 04:55:14 +0000 (20:55 -0800)]
Fix infinite loop in pb_check_proto3_default_value
- Occurs with proto3, PB_FIELD_16BIT and submessage > 255 bytes
- Add test case for PB_FIELD_16BIT and proto3
Petteri Aimonen [Fri, 24 Feb 2017 19:00:51 +0000 (21:00 +0200)]
Fix build failure
Petteri Aimonen [Fri, 24 Feb 2017 18:49:36 +0000 (20:49 +0200)]
Add test coverage for calling pb_release() on a message with callback fields.
Petteri Aimonen [Wed, 22 Feb 2017 19:11:01 +0000 (21:11 +0200)]
Add fixed length bytes to alltypes test case (issue #244)
Petteri Aimonen [Wed, 22 Feb 2017 19:06:32 +0000 (21:06 +0200)]
Extend inline / fixed length bytes array support (issue #244)
Adds support for proto3 and POINTER field types to have
fixed length bytes arrays. Also changed the .proto option
to a separate fixed_length:true, while also supporting the old FT_INLINE
option.
Restructured the generator and decoder logic to threat the inline
bytes fields more like "just another field type".
Petteri Aimonen [Mon, 20 Feb 2017 13:47:44 +0000 (15:47 +0200)]
Add new option max_length for strings (issue #107)
Max_size is the allocated size, so users had to add +1 for
the null terminator. Max_length does the +1 automatically
in the generator.
Petteri Aimonen [Mon, 13 Feb 2017 01:53:11 +0000 (03:53 +0200)]
Update download links (changes in webhost system)
Petteri Aimonen [Sun, 12 Feb 2017 08:52:26 +0000 (10:52 +0200)]
Merge branch 'master' of github.com:nanopb/nanopb
Petteri Aimonen [Sun, 12 Feb 2017 08:48:51 +0000 (10:48 +0200)]
Zero-valued extension fields were mistakenly ignored by encoder. (issue #242)
Petteri Aimonen [Sun, 12 Feb 2017 08:45:07 +0000 (10:45 +0200)]
Add regression test for issue 242
Petteri Aimonen [Sat, 21 Jan 2017 07:20:26 +0000 (09:20 +0200)]
Merge pull request #239 from mxk/plugin-fix
Fix documentation for protoc --plugin argument
Maxim Khitrov [Fri, 20 Jan 2017 23:25:10 +0000 (18:25 -0500)]
Fix documentation for protoc --plugin argument
Petteri Aimonen [Wed, 18 Jan 2017 07:02:28 +0000 (09:02 +0200)]
Merge pull request #237 from wak-google/fix-build
WIP: cmake cleanup to support installable host tooling
Petteri Aimonen [Wed, 18 Jan 2017 07:00:38 +0000 (09:00 +0200)]
Merge pull request #236 from wak-google/fix-lib
cmake: Fix library name
William A. Kennington III [Wed, 18 Jan 2017 01:22:06 +0000 (17:22 -0800)]
cmake: Cleanup the build so that host and runtime tooling is installable
Signed-off-by: William A. Kennington III <wak@google.com>
William A. Kennington III [Tue, 17 Jan 2017 20:58:48 +0000 (12:58 -0800)]
cmake: Fix library name
The produced static library should be `libprotobuf-nanopb.a`
instead of the current `liblibprotobuf-nanopb.a`.
Signed-off-by: William A. Kennington III <wak@google.com>
Petteri Aimonen [Thu, 12 Jan 2017 18:00:28 +0000 (20:00 +0200)]
Merge pull request #230 from Tobba/nonempty-substring
Fix closing a non-empty substream resulting in an incorrect stream state
Tobba [Wed, 21 Dec 2016 20:02:53 +0000 (21:02 +0100)]
Fix closing a non-empty substream resulting in an incorrect stream state
Petteri Aimonen [Sat, 31 Dec 2016 08:42:59 +0000 (10:42 +0200)]
Merge branch 'master' of github.com:nanopb/nanopb
Petteri Aimonen [Sat, 31 Dec 2016 08:33:48 +0000 (10:33 +0200)]
Fix multiple oneofs in same message (issue #229)
Previously the field iterator logic didn't know whether two
oneof fields were part of the same union, or separate. This
caused wrong pointers to be calculated if multiple oneofs were
inside a single message.
This commit fixes this by using dataoffset of PB_SIZE_MAX to
indicate union fields after the first field.
Theoretically PB_SIZE_MAX is also a valid value for data offset,
which could cause errors. Adding a compile-time assert for this
is somewhat difficult. However I consider it extremely unlikely
that there is any platform that could trigger this situation, as
it would require 255 bytes of extra data/padding between two protobuf
oneof fields. On 64-bit architectures the worst case is 16 bytes,
and even esoteric platforms only align to 64 bytes or so. Manual
modification of the generated .pb.h file could trigger this, but
even then it would require pretty bad luck to happen.
Petteri Aimonen [Sat, 31 Dec 2016 08:33:19 +0000 (10:33 +0200)]
Add testcase for issue #229
Petteri Aimonen [Fri, 23 Dec 2016 19:09:09 +0000 (21:09 +0200)]
Update readme
Petteri Aimonen [Fri, 23 Dec 2016 18:46:06 +0000 (20:46 +0200)]
Merge pull request #231 from Tobba/expose-varint32
Make pb_decode_varint32 public API
Tobba [Wed, 21 Dec 2016 15:51:47 +0000 (16:51 +0100)]
Make pb_decode_varint32 public API
Petteri Aimonen [Thu, 22 Dec 2016 15:37:14 +0000 (17:37 +0200)]
Allow overriding proto3 mode (#228)
Petteri Aimonen [Fri, 9 Dec 2016 16:57:08 +0000 (18:57 +0200)]
Enable clang integer sanitizer and clean up a few warnings.
Changed to use simple indexing instead of while (count--) in buf_read()/buf_write(),
because the count overflowed from 0 to max on the last iteration. While the unsigned
integer overflow is defined and behaviour was correct, making this simple change
allowed enabling the sanitizer which might catch true errors elsewhere in the code.
Petteri Aimonen [Fri, 9 Dec 2016 16:50:31 +0000 (18:50 +0200)]
Merge branch 'kurddt-fix_unalign' (issues #226, #227)
Petteri Aimonen [Fri, 9 Dec 2016 16:50:20 +0000 (18:50 +0200)]
Add regression test for issue #227
Petteri Aimonen [Fri, 9 Dec 2016 16:37:55 +0000 (18:37 +0200)]
Refactor proto3 logic into pb_check_proto3_default_value()
Mainly to clean up the code. Also fixed handling of
PB_LTYPE_FIXED_LENGTH_BYTES for proto3 files.
Guillaume Lager [Fri, 9 Dec 2016 09:02:08 +0000 (10:02 +0100)]
Fix potential unaligned access
If the type is string, do not try to deference it as int16, int32 or int64.
This may lead to unalign memory access, which may cause trap on some architectures (ARM)
Petteri Aimonen [Tue, 22 Nov 2016 15:25:24 +0000 (17:25 +0200)]
Merge branch 'wak-google-upstream1' (#223)
Petteri Aimonen [Tue, 22 Nov 2016 15:25:00 +0000 (17:25 +0200)]
Test case for enum_to_string
Petteri Aimonen [Tue, 22 Nov 2016 15:24:33 +0000 (17:24 +0200)]
Small indentation and naming fixes to enum_to_string functionality
William A. Kennington III [Wed, 26 Oct 2016 20:55:44 +0000 (13:55 -0700)]
nanopb: update generator to emit optional enum->string mapping function
Google-Bug-Id:
28000875
Signed-off-by: William A. Kennington III <wak@google.com>
Change-Id: I1bffd39168abe04593588291b0ebbe5199a00138
Petteri Aimonen [Sat, 19 Nov 2016 05:36:21 +0000 (07:36 +0200)]
Include version number in PlatformIO library.json (issue 222)
Petteri Aimonen [Sun, 30 Oct 2016 06:14:03 +0000 (08:14 +0200)]
Change download links to https
Petteri Aimonen [Sun, 30 Oct 2016 06:13:46 +0000 (08:13 +0200)]
Setting version to 0.3.8-dev
Petteri Aimonen [Sun, 30 Oct 2016 05:30:49 +0000 (07:30 +0200)]
Publishing nanopb-0.3.7
Petteri Aimonen [Mon, 24 Oct 2016 10:12:52 +0000 (13:12 +0300)]
Note about protoc update
Petteri Aimonen [Mon, 24 Oct 2016 09:35:59 +0000 (12:35 +0300)]
Build fix for previous commit
Petteri Aimonen [Mon, 24 Oct 2016 09:30:21 +0000 (12:30 +0300)]
Build fix for previous commit
Petteri Aimonen [Mon, 24 Oct 2016 09:26:55 +0000 (12:26 +0300)]
Strip debug symbols from linux library files
Petteri Aimonen [Sun, 23 Oct 2016 15:40:50 +0000 (18:40 +0300)]
Only run alltypes_proto3 test case if protoc version is new enough
Petteri Aimonen [Sun, 23 Oct 2016 15:01:20 +0000 (18:01 +0300)]
Update changelog and authors list
Petteri Aimonen [Sun, 23 Oct 2016 11:43:59 +0000 (14:43 +0300)]
Add test cases for proto3 has_ field support.
Petteri Aimonen [Sun, 23 Oct 2016 11:43:24 +0000 (14:43 +0300)]
Set the proto3 option by default if file specifies proto3 syntax
Petteri Aimonen [Sun, 23 Oct 2016 11:01:10 +0000 (14:01 +0300)]
Fix missing warning with large bytes fields (issue #220)
Need to generate compile time check if the bytes field + size field
might exceed 255 bytes. Also eliminated spurious checks generated
for some callback fields.
Petteri Aimonen [Tue, 11 Oct 2016 05:12:38 +0000 (08:12 +0300)]
Merge pull request #218 from berni155/master
Fix typo in encoding
berni155 [Mon, 10 Oct 2016 19:53:53 +0000 (21:53 +0200)]
Fix typo in encoding
Petteri Aimonen [Mon, 10 Oct 2016 04:25:35 +0000 (07:25 +0300)]
Merge pull request #208 from podsvirov/topic-cmake-project
Added CMake project
Petteri Aimonen [Mon, 10 Oct 2016 04:20:49 +0000 (07:20 +0300)]
Merge pull request #216 from berni155/proto3_singular_fields_support
Proto3 singular fields support
Bernhard Krämer [Sun, 9 Oct 2016 18:27:28 +0000 (20:27 +0200)]
Prevent fields with default value from encoding when proto3 option is set
Bernhard Krämer [Sun, 9 Oct 2016 18:26:28 +0000 (20:26 +0200)]
Add proto3 option to handle singular fields
Petteri Aimonen [Fri, 2 Sep 2016 04:21:24 +0000 (07:21 +0300)]
Fix typo in docs (thanks to @alecdavis)
Petteri Aimonen [Wed, 10 Aug 2016 08:41:09 +0000 (11:41 +0300)]
Merge pull request #213 from PiotrSikora/export_license
Bazel: export LICENSE.txt file.
Piotr Sikora [Wed, 10 Aug 2016 08:27:20 +0000 (01:27 -0700)]
Bazel: export LICENSE.txt file.
Signed-off-by: Piotr Sikora <piotrsikora@google.com>
Petteri Aimonen [Sat, 6 Aug 2016 07:42:04 +0000 (10:42 +0300)]
Fix formatting error in docs
Petteri Aimonen [Fri, 5 Aug 2016 04:38:53 +0000 (07:38 +0300)]
Merge pull request #211 from tmroeder/feat-inline-bytes
Add inline allocation of bytes fields
Tom Roeder [Tue, 2 Aug 2016 21:57:37 +0000 (14:57 -0700)]
Add inline allocation of bytes fields
This commit adds a new FT_INLINE allocation type that forces bytes
fields to be inlined into the struct. E.g., pb_byte_t my_bytes[32].
This requires max_size for the bytes field. The FT_INLINE type is
represented as a new LTYPE: FT_LTYPE_FIXED_LENGTH_BYTES.
This commit also updates the documentation with FT_INLINE and
FT_LTYPE_FIXED_LENGTH_BYTES.
Added an AUTHORS file in apparent order of appearance in the git log
history from $(git log --all).
Petteri Aimonen [Wed, 3 Aug 2016 06:13:26 +0000 (09:13 +0300)]
Merge pull request #209 from LuminateWireless/bazel-build
Add bazel BUILD file for nanopb.
Ming Zhao [Mon, 1 Aug 2016 19:26:37 +0000 (12:26 -0700)]
Add bazel BUILD file for nanopb.
Konstantin Podsvirov [Tue, 26 Jul 2016 20:33:33 +0000 (23:33 +0300)]
Added CMake project
Petteri Aimonen [Sat, 23 Jul 2016 17:24:54 +0000 (20:24 +0300)]
Include package name in include guard (issue #207).
Fix suggested by Ulenspiegel.
Also added testcase for the same.
Petteri Aimonen [Sun, 19 Jun 2016 07:54:26 +0000 (10:54 +0300)]
Setting version to 0.3.7-dev
Petteri Aimonen [Sun, 19 Jun 2016 07:18:03 +0000 (10:18 +0300)]
Publishing nanopb-0.3.6
Petteri Aimonen [Tue, 14 Jun 2016 15:34:44 +0000 (18:34 +0300)]
Update changelog
Petteri Aimonen [Mon, 6 Jun 2016 18:07:28 +0000 (21:07 +0300)]
Clarify security model with regard to pointer _count fields.
Petteri Aimonen [Mon, 6 Jun 2016 18:01:22 +0000 (21:01 +0300)]
Protect against corrupted _count fields in pb_release().
Fixes a potential security issue (#205). Only relevant if the user
code writes untrusted data to _count fields, but this is allowed as
per the security model.
Petteri Aimonen [Mon, 6 Jun 2016 18:00:59 +0000 (21:00 +0300)]
Add testcase for issue #205
Petteri Aimonen [Mon, 6 Jun 2016 16:33:05 +0000 (19:33 +0300)]
Add static repeated submessage field to mem_release test case.
Attempt at reproducing issue #204.
Petteri Aimonen [Wed, 25 May 2016 15:08:49 +0000 (18:08 +0300)]
Small updates to docs
Petteri Aimonen [Wed, 25 May 2016 15:03:33 +0000 (18:03 +0300)]
Fix error in STATIC_ASSERT with multiple files (issue #203)
The FieldMaxSize class was reusing the same list instance,
causing problems when multiple files were specified on the
protoc command line.
Petteri Aimonen [Wed, 25 May 2016 14:58:01 +0000 (17:58 +0300)]
Add testcase for issue #203