summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetteri Aimonen <jpa@git.mail.kapsi.fi>2014-12-26 23:03:04 +0200
committerPetteri Aimonen <jpa@git.mail.kapsi.fi>2014-12-26 23:27:34 +0200
commit58643217b1fa3eaf05768fabffac709cc8f277e8 (patch)
tree4ba0da87fb281c3f9ecde804c1cab2223bf976d6
parent1515cfb5c24f64fd046c5b5f3cdfdcb153c72df7 (diff)
Fix bug in backwards_compatibility test case.
The memset() filled also the extensions field, which was just waiting for a crash to happen.
-rw-r--r--tests/backwards_compatibility/decode_legacy.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/tests/backwards_compatibility/decode_legacy.c b/tests/backwards_compatibility/decode_legacy.c
index 9dfe437a..5f5b6bbe 100644
--- a/tests/backwards_compatibility/decode_legacy.c
+++ b/tests/backwards_compatibility/decode_legacy.c
@@ -22,10 +22,7 @@
the decoding and checks the fields. */
bool check_alltypes(pb_istream_t *stream, int mode)
{
- AllTypes alltypes;
-
- /* Fill with garbage to better detect initialization errors */
- memset(&alltypes, 0xAA, sizeof(alltypes));
+ AllTypes alltypes = {0};
if (!pb_decode(stream, AllTypes_fields, &alltypes))
return false;