summaryrefslogtreecommitdiffstats
path: root/tests/unittestproto.proto
diff options
context:
space:
mode:
authorPetteri Aimonen <jpa@git.mail.kapsi.fi>2013-04-14 09:46:39 +0300
committerPetteri Aimonen <jpa@git.mail.kapsi.fi>2013-04-14 09:46:39 +0300
commitd2063ff0b63b3b4f2f2081e61874a3c2487c4994 (patch)
treead094fd84b4fa329a02cb0be5ddf9198329f0643 /tests/unittestproto.proto
parent9939910833a9289b5913eff29f951195e7bc61c6 (diff)
Handle unterminated strings when encoding.
If the null terminator is not present, string will be limited to the data size of the field. If you are still using the pb_enc_string (deprecated since 0.1.3) from callbacks, now would be an excellent time to stop. The pb_field_t for the callback will not contain proper data_size. Use pb_encode_string() instead. Update issue 68 Status: FixedInGit
Diffstat (limited to 'tests/unittestproto.proto')
-rw-r--r--tests/unittestproto.proto4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/unittestproto.proto b/tests/unittestproto.proto
index c8a39dd6..7024942e 100644
--- a/tests/unittestproto.proto
+++ b/tests/unittestproto.proto
@@ -8,6 +8,10 @@ message FloatArray {
repeated float data = 1 [(nanopb).max_count = 10];
}
+message StringMessage {
+ required string data = 1 [(nanopb).max_size = 10];
+}
+
message CallbackArray {
// We cheat a bit and use this message for testing other types, too.
// Nanopb does not care about the actual defined data type for callback