(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-scsi-sbc.c) |
| |
| 772 | | | dissect_sbc_startstopunit (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, |
| 773 | | | guint offset, gboolean isreq _U_, gboolean iscdb, |
| 774 | | | guint payload_len _U_, scsi_task_data_t *cdata _U_) |
| 775 | | | { |
| 776 | | | guint8 flags; |
| 777 | | | static const int *ssu_fields[] = { |
| 778 | | | &hf_scsi_sbc_ssu_immed, |
| 779 | | | NULL |
| 780 | | | }; |
| 781 | | | static const int *pwr_fields[] = { |
| 782 | | | &hf_scsi_sbc_ssu_pwr_cond, |
| 783 | | | &hf_scsi_sbc_ssu_loej, |
| 784 | | | &hf_scsi_sbc_ssu_start, |
| 785 | | | NULL |
| 786 | | | }; |
| 787 | | | |
| 788 | | | if (!tree || !iscdb) |
| 789 | | | return; |
| 790 | | | |
| 791 | | | if (isreq && iscdb) { |
Redundant Condition
iscdb always evaluates to true. This may be because: - There is a constant assignment to one or more of the variables involved.
- An earlier conditional statement has already ensured that iscdb cannot be false.
- A crashing bug occurs on every path where iscdb could have evaluated to false. Look for a preceding Null Pointer Dereference or Division By Zero warning.
|
|
| 792 | | | proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_ssu_immed_flags, ett_scsi_ssu_immed, ssu_fields, FALSE); |
| 793 | | | |
| 794 | | | proto_tree_add_bitmask(tree, tvb, offset+3, hf_scsi_sbc_ssu_pwr_flags, ett_scsi_ssu_pwr, pwr_fields, FALSE); |
| 795 | | | |
| 796 | | | |
| 797 | | | flags = tvb_get_guint8 (tvb, offset+4); |
| 798 | | | proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+4, 1, |
| 799 | | | flags, |
| 800 | | | "Vendor Unique = %u, NACA = %u, Link = %u", |
| 801 | | | flags & 0xC0, flags & 0x4, flags & 0x1); |
| 802 | | | } |
| 803 | | | } |
| |