aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetteri Aimonen <jpa@git.mail.kapsi.fi>2014-05-17 20:28:33 +0300
committerPetteri Aimonen <jpa@git.mail.kapsi.fi>2014-05-17 20:28:33 +0300
commit9cf788de5463e42aaf8a24ac35a3541fdaf8c517 (patch)
tree23289f44c5ce890d8f907fcb182a1010cc82050c
parent5ef128616baffd15bb904fc56f651d40901be429 (diff)
Fix bug in alltypes test case that made fuzzing difficult.
-rw-r--r--tests/alltypes/decode_alltypes.c1
-rw-r--r--tests/alltypes_callback/decode_alltypes_callback.c1
-rw-r--r--tests/alltypes_pointer/decode_alltypes_pointer.c1
-rw-r--r--tests/field_size_16/alltypes.proto2
-rw-r--r--tests/field_size_32/alltypes.proto2
5 files changed, 7 insertions, 0 deletions
diff --git a/tests/alltypes/decode_alltypes.c b/tests/alltypes/decode_alltypes.c
index db72bb9f..0202ebc1 100644
--- a/tests/alltypes/decode_alltypes.c
+++ b/tests/alltypes/decode_alltypes.c
@@ -23,6 +23,7 @@ bool check_alltypes(pb_istream_t *stream, int mode)
/* Fill with garbage to better detect initialization errors */
memset(&alltypes, 0xAA, sizeof(alltypes));
+ alltypes.extensions = 0;
if (!pb_decode(stream, AllTypes_fields, &alltypes))
return false;
diff --git a/tests/alltypes_callback/decode_alltypes_callback.c b/tests/alltypes_callback/decode_alltypes_callback.c
index 81274f60..b6017fe6 100644
--- a/tests/alltypes_callback/decode_alltypes_callback.c
+++ b/tests/alltypes_callback/decode_alltypes_callback.c
@@ -220,6 +220,7 @@ bool check_alltypes(pb_istream_t *stream, int mode)
/* Fill with garbage to better detect initialization errors */
memset(&alltypes, 0xAA, sizeof(alltypes));
+ alltypes.extensions = 0;
alltypes.req_int32.funcs.decode = &read_varint;
alltypes.req_int32.arg = (void*)-1001;
diff --git a/tests/alltypes_pointer/decode_alltypes_pointer.c b/tests/alltypes_pointer/decode_alltypes_pointer.c
index 889676b4..1e719019 100644
--- a/tests/alltypes_pointer/decode_alltypes_pointer.c
+++ b/tests/alltypes_pointer/decode_alltypes_pointer.c
@@ -19,6 +19,7 @@ bool check_alltypes(pb_istream_t *stream, int mode)
/* Fill with garbage to better detect initialization errors */
memset(&alltypes, 0xAA, sizeof(alltypes));
+ alltypes.extensions = 0;
if (!pb_decode(stream, AllTypes_fields, &alltypes))
return false;
diff --git a/tests/field_size_16/alltypes.proto b/tests/field_size_16/alltypes.proto
index 7494853d..81693c00 100644
--- a/tests/field_size_16/alltypes.proto
+++ b/tests/field_size_16/alltypes.proto
@@ -107,5 +107,7 @@ message AllTypes {
// Just to make sure that the size of the fields has been calculated
// properly, i.e. otherwise a bug in last field might not be detected.
required int32 end = 10099;
+
+ extensions 200 to 255;
}
diff --git a/tests/field_size_32/alltypes.proto b/tests/field_size_32/alltypes.proto
index 17f17eeb..81717bbc 100644
--- a/tests/field_size_32/alltypes.proto
+++ b/tests/field_size_32/alltypes.proto
@@ -107,5 +107,7 @@ message AllTypes {
// Just to make sure that the size of the fields has been calculated
// properly, i.e. otherwise a bug in last field might not be detected.
required int32 end = 13432099;
+
+ extensions 200 to 255;
}