From 002a2495bea40a4d192cb9d22687fa16ad92c739 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 23 Nov 2014 20:23:35 +0200 Subject: [PATCH] radiotap: Initialize all members in ieee80211_radiotap_iterator_init() _next_ns_data could look like it would be used uninitialized in ieee80211_radiotap_iterator_next() to static analyzers. Avoid unnecessary reports by explicitly initializing all variables in struct ieee80211_radiotap_iterator. (CID 62878) Signed-off-by: Jouni Malinen --- src/utils/radiotap.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/utils/radiotap.c b/src/utils/radiotap.c index 197a4af98..f8f815a86 100644 --- a/src/utils/radiotap.c +++ b/src/utils/radiotap.c @@ -109,6 +109,7 @@ int ieee80211_radiotap_iterator_init( iterator->_arg_index = 0; iterator->_bitmap_shifter = get_unaligned_le32(&radiotap_header->it_present); iterator->_arg = (uint8_t *)radiotap_header + sizeof(*radiotap_header); + iterator->_next_ns_data = NULL; iterator->_reset_on_ext = 0; iterator->_next_bitmap = &radiotap_header->it_present; iterator->_next_bitmap++; @@ -154,6 +155,8 @@ int ieee80211_radiotap_iterator_init( } iterator->this_arg = iterator->_arg; + iterator->this_arg_index = 0; + iterator->this_arg_size = 0; /* we are all initialized happily */