429 Commits

Author SHA1 Message Date
Petteri Aimonen
cdbf51db08 Fix compilation error with generated initializers for repeated pointer fields 2014-09-07 19:49:00 +03:00
Petteri Aimonen
d0299d87ec Code coverage results were ignoring the data from encode/decode unittests.
Update issue 126
Status: Started
2014-09-07 19:25:09 +03:00
Petteri Aimonen
d82a264c41 Update security model with regards to pointer fields 2014-09-07 15:58:38 +03:00
Petteri Aimonen
df7234fd8b Fix cyclic messages support in generator. Beginnings of test.
Update issue 130
Status: Started
2014-08-28 21:23:28 +03:00
Petteri Aimonen
9e866b4853 Add missing * in migration docs 2014-08-26 18:22:13 +03:00
Petteri Aimonen
71b81ad573 Setting version to 0.3.1-dev 2014-08-26 18:20:48 +03:00
Petteri Aimonen
8dede6095e Publishing nanopb-0.3.0 nanopb-0.3.0 2014-08-26 18:08:31 +03:00
Petteri Aimonen
e60dee698a Update changelog 2014-08-26 18:08:01 +03:00
Petteri Aimonen
8a95311b51 Add pb_common.c to examples 2014-08-26 18:05:10 +03:00
Petteri Aimonen
3ed219382e Add #if guard for .pb.h version.
The version in PB_PROTO_HEADER_VERSION can be bumped whenever there
is a breaking change to the generated files, and it will then alert
to the difference.

Update issue 129
Status: FixedInGit
2014-08-19 17:55:44 +03:00
Petteri Aimonen
be0b9e047a Rename poorly named identifier to avoid name conflicts.
Update issue 106
Status: FixedInGit
2014-08-18 21:11:10 +03:00
Petteri Aimonen
62b4a8ecaa Rename UNUSED() and STATIC_ASSERT() macros with PB_ prefix.
This avoids possible namespace conflicts with other macros.
2014-08-18 20:49:48 +03:00
Petteri Aimonen
1dd9f1900f Change the _count fields to use pb_size_t datatype.
Update issue 82
Status: FixedInGit
2014-08-18 20:09:52 +03:00
Petteri Aimonen
0b517b0778 Fix windows build error in tests 2014-08-10 17:44:27 +03:00
Petteri Aimonen
adf0ab81d4 Add document detailing migration from old versions 2014-08-10 17:40:17 +03:00
Petteri Aimonen
7edf250a62 Switch pb_encode to use the common iterator logic in pb_common.c
Update issue 128
Status: FixedInGit
2014-08-10 13:01:09 +03:00
Petteri Aimonen
a641e21b34 Separate field iterator logic from pb_decode to pb_common. 2014-08-10 12:42:01 +03:00
Petteri Aimonen
0150b98be6 Setting version to 0.3.0-dev 2014-08-09 22:18:24 +03:00
Petteri Aimonen
2f05a35b5f Publishing nanopb-0.2.9 nanopb-0.2.9 2014-08-09 22:01:04 +03:00
Petteri Aimonen
4f76e64929 Update changelog 2014-08-04 19:13:39 +03:00
Petteri Aimonen
ec3bff4ba1 Generate #defines for initializing message structures.
Usage like:
MyMessage foo = MyMessage_init_default;

MyMessage_init_default will initialize to default values defined in .proto.

MyMessage_init_zero will initialize to null/zero values. Same results as {}
or {0}, but will avoid compiler warnings by initializing everything explicitly.

Update issue 79
Status: FixedInGit
2014-08-04 18:40:40 +03:00
Petteri Aimonen
1d7f60fec3 Add skip_message option to generator.
Update issue 121
Status: FixedInGit
2014-07-20 14:56:12 +03:00
Petteri Aimonen
5749606f5d Add support for inverted patterns in test framework. 2014-07-20 14:55:47 +03:00
Petteri Aimonen
eaa3c7b157 Cleanup and comment the code of network_server example.
Update issue 123
Status: FixedInGit
2014-07-20 14:44:41 +03:00
Petteri Aimonen
3cf9668c75 Do not automatically add a dot with generator -e option.
Now -e option in generator is more versatile. Especially it avoids
double-dot problem with some build systems.

Given foobar.proto, we now get:
-e .pb  =>  foobar.pb.c (default)
-e _pb  =>  foobar_pb.c
-e ''   =>  foobar.c

Note that if you have used -e option previously, you will have to prepend
. to the argument to get the same filenames as before.

Update issue 122
Status: FixedInGit
2014-07-20 14:25:11 +03:00
Petteri Aimonen
7f97ad549e Give better messages about the .options file path.
Update issue 124
Status: FixedInGit
2014-07-20 14:18:21 +03:00
Petteri Aimonen
f2f9f8a9ed Fix problem with .options file and extension fields.
The options for an extension field were being looked up under wrong name
(MessageName instead of MessageName.fieldname).

Fixed the problem and added regression test. Created a new subfolder for
regression test cases.

Update issue 125
Status: FixedInGit
2014-07-20 14:02:56 +03:00
Petteri Aimonen
788d2825b0 Add unit tests for allocate_field(). 2014-06-02 21:20:57 +03:00
Petteri Aimonen
99bc1d4f97 Make clearer that size = 0 in allocate_field() is not allowed.
Back in design phase the code used realloc() for freeing the memory
also. However, this is not entirely portable, and therefore the finished
implementation used free() separately.

There were some remnants of the size = 0 code in the allocate_field()
code, which made it somewhat confusing. This change makes it clearer
that size = 0 is not allowed (and not used by nanopb).
2014-06-02 21:12:38 +03:00
Petteri Aimonen
8a857a7f75 Don't use SIZE_MAX macro, as it is not in C89.
Update issue 120
Status: FixedInGit
2014-06-02 21:09:06 +03:00
Petteri Aimonen
8611958a7f Add PB_PACKED_STRUCT support for Keil MDK-ARM toolchain
Patch from Jon Read.

Update issue 119
Status: FixedInGit
2014-05-30 13:45:48 +03:00
Petteri Aimonen
2e9797af58 Setting version to 0.2.9-dev 2014-05-20 19:52:09 +03:00
Petteri Aimonen
2c51fb7771 Update changelog for 0.2.8 nanopb-0.2.8 2014-05-20 19:46:48 +03:00
Petteri Aimonen
916bcb3643 Publishing nanopb-0.2.8 2014-05-20 19:35:00 +03:00
Petteri Aimonen
9cf788de54 Fix bug in alltypes test case that made fuzzing difficult. 2014-05-17 20:28:33 +03:00
Petteri Aimonen
5ef128616b Fix security issue with PB_ENABLE_MALLOC.
The multiplication in allocate_field could potentially overflow,
leading to allocating too little memory. This could subsequently
allow an attacker to cause a write past the buffer, overwriting
other memory contents.

The attack is possible if untrusted message data is decoded using
nanopb, and the message type includes a pointer-type string or bytes
field, or a repeated numeric field. Submessage fields are not
affected.

This issue only affects systems that have been compiled with
PB_ENABLE_MALLOC enabled. Only version nanopb-0.2.7 is affected,
as prior versions do not include this functionality.

Update issue 117
Status: FixedInGit
2014-05-17 20:06:55 +03:00
Petteri Aimonen
ba2ab9ea65 Docs update, remove malloc from limitations list 2014-04-26 20:11:54 +03:00
Petteri Aimonen
e6a57e512f Add option to not add timestamps to .pb.h and .pb.c preambles.
Patch by rusnakp.

Update issue 115
Status: FixedInGit
2014-04-18 15:40:40 +03:00
Petteri Aimonen
d177af1639 Fix typos in scons command line options 2014-04-15 20:30:50 +03:00
Petteri Aimonen
3b36235cef Remove -O0 from tests CFLAGS so that optimized builds can be tested also 2014-04-15 20:27:38 +03:00
Petteri Aimonen
1d249a48ea Fix bug in missing_fields test case 2014-04-09 19:39:12 +03:00
Petteri Aimonen
3e83d81b09 Use -fsanitize=undefined when running tests with clang 2014-04-09 19:28:57 +03:00
Petteri Aimonen
938c7ac3f3 Setting version to 0.2.8-dev 2014-04-07 20:45:04 +03:00
Petteri Aimonen
6d74c66ada Publishing nanopb-0.2.7 nanopb-0.2.7 2014-04-07 20:30:42 +03:00
Petteri Aimonen
c998ffe117 Update changelog 2014-04-07 20:30:12 +03:00
Petteri Aimonen
a8de6acf2d Add rule for building coverage summary using lcov.
Also modified a few tests to be more compatible with coverage information,
so that they use the same pb_encode/decode.c instead of making a copy.
2014-04-05 13:26:37 +03:00
Petteri Aimonen
7880f308ea Fix unused parameter warning when building without errmsg. 2014-04-05 13:25:44 +03:00
Petteri Aimonen
b63e582bdb Add a convenience function pb_get_encoded_size()
There is minimal size penalty from this, and it is probably much more
intuitive to use than PB_OSTREAM_SIZING itself.

This has been suggested before also, but I ended up refusing it back
them. Reconsidering it now, I see that an intuitive API is much better
than any amount of documentation explaining a non-intuitive API.

Update issue 16
Status: FixedInGit
2014-04-05 11:26:39 +03:00
Petteri Aimonen
e5b855fec5 Add a 'found' field to pb_extension_t.
Update issue 112
Status: FixedInGit
2014-04-05 11:11:05 +03:00
Petteri Aimonen
70dee34da6 Add some missing 'static' specifiers
Update issue 91
Status: FixedInGit
2014-04-02 21:08:15 +03:00