From: Petteri Aimonen Date: Fri, 26 Dec 2014 21:03:04 +0000 (+0200) Subject: Fix bug in backwards_compatibility test case. X-Git-Tag: 5.0.2~186^2~178 X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=commitdiff_plain;h=58643217b1fa3eaf05768fabffac709cc8f277e8;hp=1515cfb5c24f64fd046c5b5f3cdfdcb153c72df7;p=apps%2Fagl-service-can-low-level.git Fix bug in backwards_compatibility test case. The memset() filled also the extensions field, which was just waiting for a crash to happen. --- 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;