diff options
author | Anders Broman <anders.broman@ericsson.com> | 2012-03-21 13:07:23 +0000 |
---|---|---|
committer | Anders Broman <anders.broman@ericsson.com> | 2012-03-21 13:07:23 +0000 |
commit | f85baa9dfa45f1a07450cb0e792240181d77cc61 (patch) | |
tree | ce6185ce2befaa63e7a366faa562e9c3c823af42 /epan | |
parent | 611dcb0d6853a00c6be755b38d99a310c70d57e5 (diff) |
From Guy Martin:
Fix
Coverity has 3 complaints about this dissector, reported in CID's 1450-1451
CONSTANT_EXPRESSION_RESULT:
Event result_independent_of_operands: (crid & 3) >> 2 is 0 regardless of the
values of its operands [non-specific operand of assignment].
1385 crid_type = (crid &
MPEG_DESCR_CONTENT_IDENTIFIER_CRID_LOCATION_MASK) >> 2;
Event result_independent_of_operands: flags & 0x1000 is always 0 regardless of
the values of its operands (logical operand of if).
1512 if (flags & MPEG_DESCR_LOGON_INITIALIZE_CONNECTIVITY_MASK) {
Event result_independent_of_operands: flags & 0x1000 is always 0 regardless of
the values of its operands (logical second operand of '&&').
1544 if (offset < end && (flags &
MPEG_DESCR_LOGON_INITIALIZE_CONNECTIVITY_MASK)) {
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6960
svn path=/trunk/; revision=41722
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-mpeg-descriptor.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/epan/dissectors/packet-mpeg-descriptor.c b/epan/dissectors/packet-mpeg-descriptor.c index 8b077fe016..270c73eac8 100644 --- a/epan/dissectors/packet-mpeg-descriptor.c +++ b/epan/dissectors/packet-mpeg-descriptor.c @@ -1382,7 +1382,7 @@ proto_mpeg_descriptor_dissect_content_identifier(tvbuff_t *tvb, guint offset, gu while (offset < end) { crid = tvb_get_guint8(tvb, offset); - crid_type = (crid & MPEG_DESCR_CONTENT_IDENTIFIER_CRID_LOCATION_MASK) >> 2; + crid_type = (crid & MPEG_DESCR_CONTENT_IDENTIFIER_CRID_TYPE_MASK) >> 2; crid_location = crid & MPEG_DESCR_CONTENT_IDENTIFIER_CRID_LOCATION_MASK; if (crid_location == 0) { @@ -1486,6 +1486,7 @@ proto_mpeg_descriptor_dissect_logon_initialize(tvbuff_t *tvb, guint offset, guin guint end = offset + len; guint8 flags = 0; + guint16 flags2 = 0; proto_tree_add_item(tree, hf_mpeg_descr_logon_initialize_group_id, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; @@ -1509,7 +1510,8 @@ proto_mpeg_descriptor_dissect_logon_initialize(tvbuff_t *tvb, guint offset, guin proto_tree_add_item(tree, hf_mpeg_descr_logon_initialize_traffic_burst_type, tvb, offset, 1, ENC_BIG_ENDIAN); if (flags & MPEG_DESCR_LOGON_INITIALIZE_TRAFFIC_BURST_TYPE_MASK) { proto_tree_add_item(tree, hf_mpeg_descr_logon_initialize_connectivity, tvb, offset, 2, ENC_BIG_ENDIAN); - if (flags & MPEG_DESCR_LOGON_INITIALIZE_CONNECTIVITY_MASK) { + flags2 = tvb_get_ntohs(tvb, offset); + if (flags2 & MPEG_DESCR_LOGON_INITIALIZE_CONNECTIVITY_MASK) { proto_tree_add_item(tree, hf_mpeg_descr_logon_initialize_return_signalling_vpi_reserved, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_mpeg_descr_logon_initialize_return_signalling_vpi, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; @@ -1541,7 +1543,7 @@ proto_mpeg_descriptor_dissect_logon_initialize(tvbuff_t *tvb, guint offset, guin offset += 2; } - if (offset < end && (flags & MPEG_DESCR_LOGON_INITIALIZE_CONNECTIVITY_MASK)) { + if (offset < end && (flags & MPEG_DESCR_LOGON_INITIALIZE_CAPACITY_TYPE_FLAG_MASK)) { proto_tree_add_item(tree, hf_mpeg_descr_logon_initialize_cra_level, tvb, offset, 3, ENC_BIG_ENDIAN); offset += 3; |