(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-smb-pipe.c) |
| |
| 278 | | | add_byte_param(tvbuff_t *tvb, int offset, int count, packet_info *pinfo _U_, |
| 279 | | | proto_tree *tree, int convert _U_, int hf_index) |
| 280 | | | { |
| 281 | | | guint8 BParam; |
| 282 | | | *hfinfo; |
| 283 | | | |
| 284 | | | if (hf_index != -1) { |
| 285 | | | hfinfo = proto_registrar_get_nth(hf_index); |
| 286 | | | if (hfinfo && count != 1 && |
| 287 | | | (hfinfo->type == FT_INT8 || hfinfo->type == FT_UINT8) |
| 288 | | | && count != 1) { |
Redundant Condition
count != 1 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 count != 1 cannot be false.
- A crashing bug occurs on every path where count != 1 could have evaluated to false. Look for a preceding Null Pointer Dereference or Division By Zero warning.
|
|
| 289 | | | THROW(ReportedBoundsError);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/exceptions.h |
| |
223 | #define THROW(x) \ |
224 | except_throw(XCEPT_GROUP_WIRESHARK, (x), NULL) |
| |
|
| 290 | | | } |
| 291 | | | proto_tree_add_item(tree, hf_index, tvb, offset, count, TRUE); |
| 292 | | | } else { |
| 293 | | | if (count == 1) { |
| 294 | | | BParam = tvb_get_guint8(tvb, offset); |
| 295 | | | proto_tree_add_text(tree, tvb, offset, count, |
| 296 | | | "Byte Param: %u (0x%02X)", |
| 297 | | | BParam, BParam); |
| 298 | | | } else { |
| 299 | | | proto_tree_add_text(tree, tvb, offset, count, |
| 300 | | | "Byte Param: %s", |
| 301 | | | tvb_bytes_to_str(tvb, offset, count)); |
| 302 | | | } |
| 303 | | | } |
| 304 | | | offset += count; |
| 305 | | | return offset; |
| 306 | | | } |
| |