(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-ayiya.c) |
| |
| 94 | | | dissect_ayiya(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) |
| 95 | | | { |
| 96 | | | proto_tree *ayiya_tree; |
| 97 | | | int offset = 0; |
| 98 | | | int idlen, siglen, ayiya_len; |
| 99 | | | guint8 , opcode; |
| 100 | | | tvbuff_t *payload; |
| 101 | | | |
| 102 | | | idlen = 1 << tvb_get_bits8(tvb, 0, 4); |
Ignored Return Value
The return value of tvb_get_bits8() is never checked in the highlighted execution scenario. - If the return value can indicate an error, the error will be ignored if the highlighted code executes.
- The return value of tvb_get_bits8() is checked 98% of the time in this project. CodeSonar is configured to enforce Ignored Return Value checks for any function whose return value is checked at least 96% of the time, unless the function is used fewer than 20 times. (To modify these thresholds, use configuration file parameters RETURN_CHECKER_SAMPLE_SIZE and RETURN_CHECKER_RATIO. To exempt tvb_get_bits8() from the Ignored Return Value check, use configuration file parameter RETURN_CHECKER_IGNORED_FUNCS).
Show: All events | Only primary events |
|
| 103 | | | siglen = tvb_get_bits8(tvb, 8, 4) * 4; |
| 104 | | | opcode = tvb_get_bits8(tvb, 20, 4); |
| 105 | | | = tvb_get_guint8(tvb, 3); |
| 106 | | | |
| 107 | | | ayiya_len = 8+idlen+siglen; |
| 108 | | | |
| 109 | | | if (check_col(pinfo->cinfo, COL_PROTOCOL)) |
Event 2:
Taking true branch. check_col(...) evaluates to true.
hide
|
|
| 110 | | | col_set_str(pinfo->cinfo, COL_PROTOCOL, "AYIYA"); |
| 111 | | | |
| 112 | | | if (tree) { |
Event 3:
Skipping " if". tree evaluates to false.
hide
|
|
| 113 | | | proto_item *ti; |
| 114 | | | nstime_t tv; |
| 115 | | | ti = proto_tree_add_protocol_format( tree, proto_ayiya, tvb, |
| 116 | | | offset, ayiya_len, "AYIYA" ); |
| 117 | | | ayiya_tree = proto_item_add_subtree(ti, ett_ayiya); |
| 118 | | | |
| 119 | | | proto_tree_add_bits_item(ayiya_tree, hf_id_len, tvb, 0, 4, FALSE); |
| 120 | | | proto_tree_add_bits_item(ayiya_tree, hf_id_type, tvb, 4, 4, FALSE); |
| 121 | | | proto_tree_add_bits_item(ayiya_tree, hf_sig_len, tvb, 8, 4, FALSE); |
| 122 | | | proto_tree_add_bits_item(ayiya_tree, hf_hash_method, tvb, 12, 4, FALSE); |
| 123 | | | proto_tree_add_bits_item(ayiya_tree, hf_auth_method, tvb, 16, 4, FALSE); |
| 124 | | | proto_tree_add_bits_item(ayiya_tree, hf_opcode, tvb, 20, 4, FALSE); |
| 125 | | | proto_tree_add_uint_format(ayiya_tree, , tvb, |
| 126 | | | 3, 1, , |
| 127 | | | "Next : %s (0x%02x)", |
| 128 | | | ipprotostr(), ); |
| 129 | | | tv.secs = tvb_get_ntohl(tvb, 4); |
| 130 | | | tv.nsecs = 0; |
| 131 | | | proto_tree_add_time(ayiya_tree, hf_epoch, tvb, 4, 4, &tv); |
| 132 | | | proto_tree_add_item(ayiya_tree, hf_identity, tvb, 8, idlen, FALSE); |
| 133 | | | proto_tree_add_item(ayiya_tree, hf_signature, tvb, 8+idlen, siglen, FALSE); |
| 134 | | | } |
| 135 | | | offset = ayiya_len; |
| 136 | | | switch (opcode) { |
Event 4:
opcode evaluates to implicit-default.
hide
|
|
| 137 | | | case OPCODE_FORWARD: |
| 138 | | | payload = tvb_new_subset(tvb, offset, -1, -1); |
| 139 | | | dissector_try_port(ip_dissector_table, , payload, pinfo, tree); |
| 140 | | | break; |
| 141 | | | } |
| 142 | | | } |
| |