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 <j@w1.fi>
This commit is contained in:
Jouni Malinen 2014-11-23 20:23:35 +02:00
parent 5d017065a0
commit 002a2495be

View file

@ -109,6 +109,7 @@ int ieee80211_radiotap_iterator_init(
iterator->_arg_index = 0; iterator->_arg_index = 0;
iterator->_bitmap_shifter = get_unaligned_le32(&radiotap_header->it_present); iterator->_bitmap_shifter = get_unaligned_le32(&radiotap_header->it_present);
iterator->_arg = (uint8_t *)radiotap_header + sizeof(*radiotap_header); iterator->_arg = (uint8_t *)radiotap_header + sizeof(*radiotap_header);
iterator->_next_ns_data = NULL;
iterator->_reset_on_ext = 0; iterator->_reset_on_ext = 0;
iterator->_next_bitmap = &radiotap_header->it_present; iterator->_next_bitmap = &radiotap_header->it_present;
iterator->_next_bitmap++; iterator->_next_bitmap++;
@ -154,6 +155,8 @@ int ieee80211_radiotap_iterator_init(
} }
iterator->this_arg = iterator->_arg; iterator->this_arg = iterator->_arg;
iterator->this_arg_index = 0;
iterator->this_arg_size = 0;
/* we are all initialized happily */ /* we are all initialized happily */