From 58643217b1fa3eaf05768fabffac709cc8f277e8 Mon Sep 17 00:00:00 2001 From: Petteri Aimonen Date: Fri, 26 Dec 2014 23:03:04 +0200 Subject: [PATCH 1/1] Fix bug in backwards_compatibility test case. The memset() filled also the extensions field, which was just waiting for a crash to happen. --- tests/backwards_compatibility/decode_legacy.c | 5 +---- 1 file changed, 1 insertion(+), 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; -- 2.16.6