From 29d51623c2b7a9ba970fccee6abb131e7fbc85c6 Mon Sep 17 00:00:00 2001 From: Jeff Morriss Date: Tue, 4 Jun 2013 01:38:53 +0000 Subject: [PATCH] From Ed Beroset via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8762 : Remove dead code (condition can never happen). svn path=/trunk/; revision=49743 --- asn1/c1222/packet-c1222-template.c | 8 ++------ epan/dissectors/packet-c1222.c | 14 +++++--------- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/asn1/c1222/packet-c1222-template.c b/asn1/c1222/packet-c1222-template.c index e2158b6eca..adfce1ce25 100644 --- a/asn1/c1222/packet-c1222-template.c +++ b/asn1/c1222/packet-c1222-template.c @@ -590,11 +590,7 @@ parse_c1222_detailed(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int cm /* don't do anything */ proto_item_set_text(tree, "C12.22 EPSEM: %s", val_to_str(cmd, commandnames, "Unknown (0x%02x)")); if (*length) { - if (*length >= *length) { - proto_tree_add_item(tree, hf_c1222_data, tvb, *offset, *length, ENC_NA); - } else { - expert_add_info_format_text(pinfo, tree, &ei_c1222_command_truncated, "C12.22 unknown command truncated"); - } + proto_tree_add_item(tree, hf_c1222_data, tvb, *offset, *length, ENC_NA); } break; } @@ -1361,7 +1357,7 @@ proto_reg_handoff_c1222(void) if( !initialized ) { c1222_handle = create_dissector_handle(dissect_c1222, proto_c1222); - c1222_udp_handle = create_dissector_handle(dissect_c1222_common, proto_c1222); + c1222_udp_handle = create_dissector_handle(dissect_c1222_common, proto_c1222); dissector_add_uint("tcp.port", global_c1222_port, c1222_handle); dissector_add_uint("udp.port", global_c1222_port, c1222_udp_handle); initialized = TRUE; diff --git a/epan/dissectors/packet-c1222.c b/epan/dissectors/packet-c1222.c index adb36fb54d..b077b62d05 100644 --- a/epan/dissectors/packet-c1222.c +++ b/epan/dissectors/packet-c1222.c @@ -638,11 +638,7 @@ parse_c1222_detailed(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int cm /* don't do anything */ proto_item_set_text(tree, "C12.22 EPSEM: %s", val_to_str(cmd, commandnames, "Unknown (0x%02x)")); if (*length) { - if (*length >= *length) { - proto_tree_add_item(tree, hf_c1222_data, tvb, *offset, *length, ENC_NA); - } else { - expert_add_info_format_text(pinfo, tree, &ei_c1222_command_truncated, "C12.22 unknown command truncated"); - } + proto_tree_add_item(tree, hf_c1222_data, tvb, *offset, *length, ENC_NA); } break; } @@ -1495,7 +1491,7 @@ static void dissect_C1222_MESSAGE_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, /*--- End of included file: packet-c1222-fn.c ---*/ -#line 1001 "../../asn1/c1222/packet-c1222-template.c" +#line 997 "../../asn1/c1222/packet-c1222-template.c" /** * Dissects a a full (reassembled) C12.22 message. @@ -1868,7 +1864,7 @@ void proto_register_c1222(void) { "OCTET_STRING_SIZE_CONSTR002", HFILL }}, /*--- End of included file: packet-c1222-hfarr.c ---*/ -#line 1277 "../../asn1/c1222/packet-c1222-template.c" +#line 1273 "../../asn1/c1222/packet-c1222-template.c" }; /* List of subtrees */ @@ -1890,7 +1886,7 @@ void proto_register_c1222(void) { &ett_c1222_Calling_authentication_value_c1221_U, /*--- End of included file: packet-c1222-ettarr.c ---*/ -#line 1287 "../../asn1/c1222/packet-c1222-template.c" +#line 1283 "../../asn1/c1222/packet-c1222-template.c" }; static ei_register_info ei[] = { @@ -1968,7 +1964,7 @@ proto_reg_handoff_c1222(void) if( !initialized ) { c1222_handle = create_dissector_handle(dissect_c1222, proto_c1222); - c1222_udp_handle = create_dissector_handle(dissect_c1222_common, proto_c1222); + c1222_udp_handle = create_dissector_handle(dissect_c1222_common, proto_c1222); dissector_add_uint("tcp.port", global_c1222_port, c1222_handle); dissector_add_uint("udp.port", global_c1222_port, c1222_udp_handle); initialized = TRUE;