wireshark/epan
Peter Wu 47829b9611 cops: try to avoid uninitialized warning error
Valgrind 3.11.0 on the Ubuntu 16.04 buildbot reports that
cops_call->solicited is not initialized:

    pdus_array = (GPtrArray *)wmem_map_lookup(cops_conv_info->pdus_tree, GUINT_TO_POINTER(handle_value));
    /* ... */
    for (i=0; i < pdus_array->len; i++) {
        cops_call = (cops_call_t*)g_ptr_array_index(pdus_array, i);
        if ( /* ... */
        ( (cops_call->op_code == COPS_MSG_KA && !(cops_call->solicited)) &&
                                                  ^^^^^^^^^^^^^^^^^^^^

which is clearly bogus since the only place where cops_call could be
created is a few lines up:

    ver_flags = tvb_get_guint8(tvb, offset);
    is_solicited = (lo_nibble(ver_flags) == 0x01);
    /* ... */
    pdus_array = (GPtrArray *)wmem_map_lookup(cops_conv_info->pdus_tree, GUINT_TO_POINTER(handle_value));
    if (pdus_array == NULL) {
        pdus_array = g_ptr_array_new();
        wmem_map_insert(cops_conv_info->pdus_tree, GUINT_TO_POINTER(handle_value), pdus_array);
    }
    /* ... */
    cops_call = wmem_new(wmem_file_scope(), cops_call_t);
    cops_call->op_code = op_code;
    cops_call->solicited = is_solicited;
    /* ... */
    g_ptr_array_add(pdus_array, cops_call);

Try to zero the whole structure to avoid this bogus warning.

Change-Id: I1ec4d23e99c987849af580a1c8134610c383e55e
Ping-Bug: 13044
Ping-Bug: 13203
Reviewed-on: https://code.wireshark.org/review/19119
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2016-12-07 00:46:10 +00:00
..
compress Remove Makefile.common files 2016-06-30 11:04:17 +00:00
crypt Squelch a casting-away-constness warning. 2016-12-04 03:03:11 +00:00
dfilter Include config.h at the very beginning of all Flex scanners. 2016-12-02 21:02:10 +00:00
dissectors cops: try to avoid uninitialized warning error 2016-12-07 00:46:10 +00:00
ftypes ftype-guid.c: fix FT_GUID filtering 2016-11-11 16:17:19 +00:00
wmem Add wmem_list_find_custom() 2016-10-24 21:01:56 +00:00
wslua Include config.h first, for large-file-related #defines. 2016-12-02 21:06:24 +00:00
.editorconfig
CMakeLists.txt Enable exporting objects with tshark 2016-12-02 16:07:35 +00:00
Makefile.am Enable exporting objects with tshark 2016-12-02 16:07:35 +00:00
addr_and_mask.c
addr_and_mask.h
addr_resolv.c Improve name resolution preference tooltips. 2016-11-22 16:47:11 +00:00
addr_resolv.h Resolv: various code / comment cleanups 2016-11-16 05:15:52 +00:00
address.h Add address_to_bytes API. 2016-06-22 07:47:39 +00:00
address_types.c Properly end address type search by name (CID-1362742) 2016-08-26 16:49:57 +00:00
address_types.h Add address_to_bytes API. 2016-06-22 07:47:39 +00:00
afn.c
afn.h
aftypes.c
aftypes.h
app_mem_usage.c app_mem_usage: rename shadow variable 2016-06-26 06:04:09 +00:00
app_mem_usage.h app_mem_usage: rename shadow variable 2016-06-26 06:04:09 +00:00
arcnet_pids.h
arptypes.h
asm_utils.c
asm_utils.h
asm_utils_win32_x86.asm
asn1.c Fix checkAPI.pl warnings about printf 2016-07-25 04:26:50 +00:00
asn1.h
ax25_pids.h
bridged_pids.h
capture_dissectors.c Implement registration of capture dissectors by name 2016-10-28 17:39:04 +00:00
capture_dissectors.h Implement registration of capture dissectors by name 2016-10-28 17:39:04 +00:00
charsets.c Add T.61 character set support 2016-10-22 03:16:11 +00:00
charsets.h Add T.61 character set support 2016-10-22 03:16:11 +00:00
chdlctypes.h
circuit.c circuit: rename shadow variable 2016-06-26 06:05:51 +00:00
circuit.h circuit(.h): fix indent (and add modelines) 2016-06-27 01:20:56 +00:00
color_filters.c Color filters: Initialize a variable. 2016-10-04 16:11:14 +00:00
color_filters.h Qt: Color _ANY and _TCP sequence analysis items. 2016-06-01 04:27:13 +00:00
column-info.h Allow control of individual columns to be (un)writable. 2016-06-15 06:03:57 +00:00
column-utils.c column-utils: add space to improve readability. 2016-10-08 18:16:05 +00:00
column-utils.h Allow control of individual columns to be (un)writable. 2016-06-15 06:03:57 +00:00
column.c Fix lintian found spelling error "occurence" -> "occurrence" 2016-11-03 02:31:20 +00:00
column.h
conv_id.h
conversation.c packet-infiniband: Fixed duplicate conversation entries 2016-12-03 13:24:16 +00:00
conversation.h conversation: rename shadow variable 2016-06-26 06:03:14 +00:00
conversation_debug.h
conversation_table.c Move AT_USB to inside USB dissector. 2016-06-22 04:57:43 +00:00
conversation_table.h
crc6-tvb.c
crc6-tvb.h
crc8-tvb.c
crc8-tvb.h
crc10-tvb.c
crc10-tvb.h
crc16-tvb.c
crc16-tvb.h
crc32-tvb.c
crc32-tvb.h
decode_as.c Some Pref <-> Decode As bugfixes. 2016-10-18 23:03:23 +00:00
decode_as.h Combine Decode As and port preferences for tcp.port dissector table. 2016-10-08 02:44:53 +00:00
diam_dict.h
diam_dict.l Include config.h at the very beginning of all Flex scanners. 2016-12-02 21:02:10 +00:00
disabled_protos.c Fix some of the checkAPIs.pl warnings for g_warning. 2016-07-26 04:08:50 +00:00
disabled_protos.h
dissector_filters.c
dissector_filters.h
doxygen.cfg.in
dtd.h
dtd_grammar.lemon
dtd_parse.h
dtd_parse.l Include config.h at the very beginning of all Flex scanners. 2016-12-02 21:02:10 +00:00
dtd_preparse.l Include config.h at the very beginning of all Flex scanners. 2016-12-02 21:02:10 +00:00
dvb_chartbl.c
dvb_chartbl.h
dwarf.c
dwarf.h
eap.h
eapol_keydes_types.h
enterprise-numbers [Automatic update for 2016-12-04] 2016-12-04 16:13:27 +00:00
epan-int.h
epan.c cql: add lz4 and snappy decompression 2016-10-17 18:28:45 +00:00
epan.h
epan_dissect.h
etypes.h etypes: Add ETHERTYPE_LINK_CTL 2016-08-18 20:47:32 +00:00
ex-opt.c ex-opt: rename shadow variable 2016-06-26 06:02:45 +00:00
ex-opt.h ex-opt: rename shadow variable 2016-06-26 06:02:45 +00:00
except.c Fix checkAPI.pl warnings about printf 2016-07-25 04:26:50 +00:00
except.h
exceptions.h
exntest.c exntest.c: Create local functions to handle "nesting" TRY/CATCH macros to fix shadow warnings. 2016-07-15 01:48:49 +00:00
expert.c Add PI_DEPRECATED expert info group 2016-08-05 13:59:25 +00:00
expert.h
export_object.c Enable exporting objects with tshark 2016-12-02 16:07:35 +00:00
export_object.h Enable exporting objects with tshark 2016-12-02 16:07:35 +00:00
exported_pdu.c Add OSI Layer 4 to exported PDU to handle TCP and UDP payloads. 2016-08-01 15:19:59 +00:00
exported_pdu.h Add OSI Layer 4 to exported PDU to handle TCP and UDP payloads. 2016-08-01 15:19:59 +00:00
filter_expressions.c filter: rename shadow var 2016-06-26 06:02:09 +00:00
filter_expressions.h filter: rename shadow var 2016-06-26 06:02:09 +00:00
follow.c tcp: Fix Follow TCP tap data and when its tapped. 2016-11-10 20:48:18 +00:00
follow.h tcp: Fix Follow TCP tap data and when its tapped. 2016-11-10 20:48:18 +00:00
frame_data.c
frame_data.h
frame_data_sequence.c
frame_data_sequence.h
funnel.c
funnel.h
garrayfix.h
geoip_db.c Improve name resolution preference tooltips. 2016-11-22 16:47:11 +00:00
geoip_db.h
golay.c
golay.h
guid-utils.c
guid-utils.h
iana_charsets.c Remove the MIBenum stuff from the WAP code. 2016-05-08 21:15:43 +00:00
iana_charsets.h Get rid of extra blank line. 2016-05-08 21:17:30 +00:00
iax2_codec_type.h
in_cksum.c Bump GLib minimum required version to 2.22.0 2016-08-04 16:13:41 +00:00
in_cksum.h
ip_opts.h
ipproto.c
ipproto.h
ipv4.c
ipv4.h
ipv6.h
lapd_sapi.h
llcsaps.h
media_params.c See if *this* convinces the compiler that valuelen and value will be set. 2016-08-23 03:36:55 +00:00
media_params.h Handle quoted-pairs in quoted-strings correctly. 2016-08-23 00:53:46 +00:00
next_tvb.c
next_tvb.h
nlpid.h
oids.c Improve name resolution preference tooltips. 2016-11-22 16:47:11 +00:00
oids.h
oids_test.c
osi-utils.c Add address_to_bytes API. 2016-06-22 07:47:39 +00:00
osi-utils.h
oui.c ieee80211: Add Meru (Fortinet) Vendor Specific TLV 2016-11-25 15:33:18 +00:00
oui.h ieee80211: Add Meru (Fortinet) Vendor Specific TLV 2016-11-25 15:33:18 +00:00
packet-range.c
packet-range.h
packet.c packet.c: split register_dissector into two separate functions 2016-10-24 19:11:14 +00:00
packet.h Combine Decode As and port preferences for tcp.port dissector table. 2016-10-08 02:44:53 +00:00
packet_info.h
params.h
plugin_if.c
plugin_if.h
ppptypes.h
prefs-int.h Combine Decode As and port preferences for tcp.port dissector table. 2016-10-08 02:44:53 +00:00
prefs.c Prefs: Use g_utf8_strlen instead of strlen. 2016-12-02 01:09:54 +00:00
prefs.h Check preference titles and descriptions. 2016-12-01 01:26:39 +00:00
print.c Honor protocols.display_hidden_proto_items preferences when outputting fields in TShark 2016-12-05 06:28:32 +00:00
print.h tshark fields filter added for other outputs 2016-06-29 08:29:16 +00:00
print.ps
print_stream.c Speed up print_line_text. 2016-06-30 19:21:04 +00:00
print_stream.h Speed up print_line_text. 2016-06-30 19:21:04 +00:00
proto.c extract common logic of proto_item_set_len/proto_item_set_end 2016-11-22 16:46:48 +00:00
proto.h Parenthesize HFILL_INIT macro properly 2016-10-24 19:05:38 +00:00
proto_data.c p_XXX_proto_data: only allow the use of pinfo and file scopes 2016-09-17 15:46:36 +00:00
proto_data.h p_XXX_proto_data: only allow the use of pinfo and file scopes 2016-09-17 15:46:36 +00:00
ps.h
ptvcursor.h
radius_dict.l Include config.h at the very beginning of all Flex scanners. 2016-12-02 21:02:10 +00:00
range.c Add range_add_value and range_remove_value. 2016-09-22 13:49:42 +00:00
range.h Combine Decode As and port preferences for tcp.port dissector table. 2016-10-08 02:44:53 +00:00
reassemble.c Reassemble: fix premature free 2016-11-19 22:58:08 +00:00
reassemble.h Fragmentation reassembly as in PPP MP (RFC 1990/2686) 2016-11-03 05:08:07 +00:00
reassemble_test.c Fragmentation reassembly as in PPP MP (RFC 1990/2686) 2016-11-03 05:08:07 +00:00
reedsolomon.c Cleanup some checkAPI warnings that were missed in previous patches. 2016-07-26 17:15:38 +00:00
reedsolomon.h
req_resp_hdrs.c
req_resp_hdrs.h
rtd_table.c
rtd_table.h
rtp_pt.h
sctpppids.h
show_exception.c Fix some of the checkAPIs.pl warnings for g_warning. 2016-07-26 04:08:50 +00:00
show_exception.h
slow_protocol_subtypes.h
sminmpec.c [Automatic update for 2016-12-04] 2016-12-04 16:13:27 +00:00
sminmpec.h Add define for vendor dacom 2016-09-20 11:46:21 +00:00
srt_table.c srt: rename shadow variable 2016-06-26 06:01:22 +00:00
srt_table.h srt: rename shadow variable 2016-06-26 06:01:22 +00:00
stat_groups.h
stat_tap_ui.c
stat_tap_ui.h qt: move free_stat_tables from SimpleStatisticsDialog::fillTree to ~SimpleStatisticsDialog. 2016-06-16 04:01:57 +00:00
stats_tree.c
stats_tree.h
stats_tree_priv.h stats_tree: rename shadow variable 2016-06-26 06:00:43 +00:00
stream.c
stream.h
strutil.c
strutil.h
t35.c
t35.h
tap-voip.h
tap.c When regestering taps, only loop trough the list of taps once when adding 2016-09-28 12:36:26 +00:00
tap.h Revert "tap: change glib functions to wmem." 2016-06-19 10:47:10 +00:00
tfs.c
tfs.h
time_fmt.h
timestamp.c
timestamp.h
timestats.c
timestats.h
to_str-int.h
to_str.c Improve support for single-character fields and filter expressions. 2016-09-19 02:51:13 +00:00
to_str.h Improve support for single-character fields and filter expressions. 2016-09-19 02:51:13 +00:00
tpg.c
tpg.h
tvbparse.c tvbparse: fix memleak 2016-08-28 22:07:22 +00:00
tvbparse.h tvbparse: change g_hash_table to wmem_map. 2016-06-14 19:34:12 +00:00
tvbtest.c tvbtest.c - Fix printf style argument types 2016-07-15 01:49:33 +00:00
tvbuff-int.h
tvbuff.c [tvbuff] Fix tvb_find_guint16() searched_bytes is from 2016-11-11 16:05:52 +00:00
tvbuff.h add tvb_find_guint16() utility 2016-10-08 03:21:44 +00:00
tvbuff_base64.c
tvbuff_composite.c tvbuff_composite.c: fix composite_get_ptr when length is over 2 segments 2016-11-13 22:30:57 +00:00
tvbuff_real.c
tvbuff_subset.c
tvbuff_zlib.c tvbuff_zlib: Check if the given offset and compressed length are indeed valid before trying to allocate memory 2016-10-05 03:28:31 +00:00
uat-int.h uat: allow insertion of new record at arbitrary index 2016-10-01 12:08:02 +00:00
uat.c uat: allow insertion of new record at arbitrary index 2016-10-01 12:08:02 +00:00
uat.h uat: fix PT_TXTMOD_HEXBYTES/PT_TXTMOD_ENUM comments 2016-10-04 01:11:14 +00:00
uat_load.l Include config.h at the very beginning of all Flex scanners. 2016-12-02 21:02:10 +00:00
value_string.c Allow up to 64-bit values to use BASE_RANGE_STRING. 2016-08-07 07:39:12 +00:00
value_string.h Allow up to 64-bit values to use BASE_RANGE_STRING. 2016-08-07 07:39:12 +00:00
x264_prt_id.h
xdlc.c
xdlc.h