diff options
author | Pascal Quantin <pascal.quantin@gmail.com> | 2018-03-17 15:29:15 +0100 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2018-03-17 20:20:23 +0000 |
commit | b4498c964f58a241e0706e19391c8c300dfa0395 (patch) | |
tree | 94fc5f6534165d3a9097ba9bc10438f38d4c838d /epan | |
parent | 05919f7af7b7a8e964ea62881c2ebaebd03beae2 (diff) |
CQL: ensure that there is at least one column to display rows
Bug: 14530
Change-Id: Ie5729c00ea4d826dbae028b3a4653acf746b92b8
Reviewed-on: https://code.wireshark.org/review/26521
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-cql.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/epan/dissectors/packet-cql.c b/epan/dissectors/packet-cql.c index 6220a3c468..c76df9aa07 100644 --- a/epan/dissectors/packet-cql.c +++ b/epan/dissectors/packet-cql.c @@ -1415,17 +1415,19 @@ dissect_cql_tcp_pdu(tvbuff_t* raw_tvb, packet_info* pinfo, proto_tree* tree, voi } offset += 4; - for (j = 0; j < result_rows_row_count; ++j) { - columns_subtree = proto_tree_add_subtree(rows_subtree, tvb, offset, 0, ett_cql_result_columns, &ti, "Data (Columns)"); - - if (offset_row_metadata) { - offset = parse_row(columns_subtree, pinfo, tvb, offset_row_metadata, offset, result_rows_columns_count); - } else { - for (k = 0; k < result_rows_columns_count; ++k) { - proto_tree_add_item_ret_int(columns_subtree, hf_cql_bytes_length, tvb, offset, 4, ENC_BIG_ENDIAN, &bytes_length); - offset += 4; - proto_tree_add_item(columns_subtree, hf_cql_bytes, tvb, offset, bytes_length, ENC_NA); - offset += bytes_length; + if (result_rows_columns_count) { + for (j = 0; j < result_rows_row_count; ++j) { + columns_subtree = proto_tree_add_subtree(rows_subtree, tvb, offset, 0, ett_cql_result_columns, &ti, "Data (Columns)"); + + if (offset_row_metadata) { + offset = parse_row(columns_subtree, pinfo, tvb, offset_row_metadata, offset, result_rows_columns_count); + } else { + for (k = 0; k < result_rows_columns_count; ++k) { + proto_tree_add_item_ret_int(columns_subtree, hf_cql_bytes_length, tvb, offset, 4, ENC_BIG_ENDIAN, &bytes_length); + offset += 4; + proto_tree_add_item(columns_subtree, hf_cql_bytes, tvb, offset, bytes_length, ENC_NA); + offset += bytes_length; + } } } } |