From 668e6bc83157f93f20933c2668c04d8143ef3dbb Mon Sep 17 00:00:00 2001 From: Jaap Keuter Date: Sun, 4 Sep 2016 00:32:33 +0200 Subject: [PATCH] ANSI_A: Rationalize test expession (CID-1372216 ... 1372267) Implement the same changes in the ELEM_TLV() and ELEM_TV() macros as in packet-gsm_a_common.h, to remove superfluous code and squelch about 50 Coverity issues. Change-Id: I262dc60fdfa3482876d8525b34f6b1dbbe371257 Reviewed-on: https://code.wireshark.org/review/17478 Reviewed-by: Michael Mann Petri-Dish: Michael Mann Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman --- epan/dissectors/packet-ansi_a.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/epan/dissectors/packet-ansi_a.c b/epan/dissectors/packet-ansi_a.c index f46cbb0e5f..5255721c20 100644 --- a/epan/dissectors/packet-ansi_a.c +++ b/epan/dissectors/packet-ansi_a.c @@ -7510,7 +7510,8 @@ elem_v(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, elem_idx_t idx, guin "Missing Mandatory element (0x%02x) %s%s, rest of dissection is suspect", \ ansi_a_elem_1_strings[elem_idx].value, \ ansi_a_elem_1_strings[elem_idx].strptr, \ - (elem_name_addition == NULL) || (elem_name_addition[0] == '\0') ? "" : elem_name_addition \ + /* coverity[array_null] */ \ + (elem_name_addition == NULL) ? "" : elem_name_addition \ ); \ } \ if (curr_len <= 0) return; \ @@ -7540,7 +7541,8 @@ elem_v(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, elem_idx_t idx, guin "Missing Mandatory element (0x%02x) %s%s, rest of dissection is suspect", \ ansi_a_elem_1_strings[elem_idx].value, \ ansi_a_elem_1_strings[elem_idx].strptr, \ - (elem_name_addition == NULL) || (elem_name_addition[0] == '\0') ? "" : elem_name_addition \ + /* coverity[array_null] */ \ + (elem_name_addition == NULL) ? "" : elem_name_addition \ ); \ } \ if (curr_len <= 0) return; \