(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-giop.c) |
| |
| 5120 | | | void decode_ServiceContextList(tvbuff_t *tvb, proto_tree *ptree, int *offset, |
| 5121 | | | gboolean stream_is_be, guint32 boundary) { |
| 5122 | | | |
| 5123 | | | guint32 seqlen; |
| 5124 | | | guint32 context_data_len; |
| 5125 | | | |
| 5126 | | | proto_tree *tree = NULL; |
| 5127 | | | proto_tree *sub_tree1 = NULL; |
| 5128 | | | proto_item *tf = NULL, *tf_st1; |
| 5129 | | | |
| 5130 | | | guint32 context_id; |
| 5131 | | | |
| 5132 | | | guint32 i; |
| 5133 | | | guint32 vscid; |
| 5134 | | | guint32 scid; |
| 5135 | | | const gchar *service_context_name; |
| 5136 | | | gboolean encapsulation_is_be; |
| 5137 | | | guint32 encapsulation_boundary; |
| 5138 | | | int temp_offset, temp_offset1; |
| 5139 | | | int start_offset = *offset; |
| 5140 | | | |
| 5141 | | | |
| 5142 | | | |
| 5143 | | | if (ptree) { |
| 5144 | | | |
| 5145 | | | tf = proto_tree_add_text (ptree, tvb, *offset, 0, "ServiceContextList"); |
| 5146 | | | |
| 5147 | | | tree = proto_item_add_subtree (tf, ett_giop_scl); |
| 5148 | | | } |
| 5149 | | | |
| 5150 | | | |
| 5151 | | | seqlen = get_CDR_ulong(tvb,offset,stream_is_be,boundary); |
| 5152 | | | |
| 5153 | | | if (tree) { |
| 5154 | | | proto_tree_add_uint(tree,hf_giop_sequence_length,tvb, |
| 5155 | | | *offset-sizeof(seqlen),4,seqlen); |
| 5156 | | | } |
| 5157 | | | |
| 5158 | | | |
| 5159 | | | |
| 5160 | | | if (seqlen == 0) { |
| 5161 | | | if (tf) { |
| 5162 | | | if (*offset - start_offset <= 0) |
| 5163 | | | 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) |
| |
|
| 5164 | | | proto_item_set_len(tf, *offset - start_offset); |
| 5165 | | | } |
| 5166 | | | |
| 5167 | | | return; |
| 5168 | | | } |
| 5169 | | | |
| 5170 | | | |
| 5171 | | | |
| 5172 | | | for (i=0; i<seqlen; i++) { |
Event 6:
Continuing from loop body. Leaving loop. i < seqlen evaluates to false.
hide
|
|
| 5173 | | | |
| 5174 | | | context_id = get_CDR_ulong(tvb,offset,stream_is_be,boundary); |
| 5175 | | | vscid = (context_id & 0xffffff00) >> 8; |
| 5176 | | | scid = context_id & 0x000000ff; |
| 5177 | | | |
| 5178 | | | if (tree) { |
| 5179 | | | proto_tree_add_uint(tree,hf_giop_iop_vscid,tvb, |
| 5180 | | | *offset-sizeof(guint32),4,vscid); |
| 5181 | | | |
| 5182 | | | proto_tree_add_uint(tree,hf_giop_iop_scid,tvb, |
| 5183 | | | *offset-sizeof(guint32),4,scid); |
| 5184 | | | |
| 5185 | | | } |
| 5186 | | | |
| 5187 | | | if( vscid == 0) { |
| 5188 | | | service_context_name = val_to_str(scid, service_context_ids, "(0x%x)"); |
Ignored Return Value
The return value of val_to_str() 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 val_to_str() 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 val_to_str() from the Ignored Return Value check, use configuration file parameter RETURN_CHECKER_IGNORED_FUNCS).
Show: All events | Only primary events |
|
| 5189 | | | } else { |
| 5190 | | | service_context_name = "Unknown"; |
| 5191 | | | } |
| 5192 | | | |
| 5193 | | | if(tree) { |
Event 2:
Skipping " if". tree evaluates to false.
hide
|
|
| 5194 | | | proto_tree_add_text (tree, tvb, *offset -sizeof(context_id), 4, |
| 5195 | | | "Service Context ID: %s (%u)", service_context_name, |
| 5196 | | | context_id); |
| 5197 | | | } |
| 5198 | | | |
| 5199 | | | temp_offset1 = *offset; |
| 5200 | | | |
| 5201 | | | if( vscid != 0 || scid > max_service_context_id ) { |
Event 3:
Skipping " if". - vscid != 0 evaluates to false.
- scid > max_service_context_id evaluates to false.
hide
|
|
| 5202 | | | decode_UnknownServiceContext(tvb, tree, offset, stream_is_be, boundary); |
| 5203 | | | continue; |
| 5204 | | | } |
| 5205 | | | |
| 5206 | | | temp_offset = *offset; |
| 5207 | | | |
| 5208 | | | context_data_len = get_CDR_encap_info(tvb, sub_tree1, offset, |
| 5209 | | | stream_is_be, boundary, |
| 5210 | | | &encapsulation_is_be , &encapsulation_boundary); |
| 5211 | | | |
| 5212 | | | if (tree) { |
Event 4:
Skipping " if". tree evaluates to false.
hide
|
|
| 5213 | | | tf_st1 = proto_tree_add_text (tree, tvb, temp_offset, sizeof(context_data_len) + context_data_len , "%s", service_context_name); |
| 5214 | | | sub_tree1 = proto_item_add_subtree (tf_st1, ett_giop_scl_st1); |
| 5215 | | | } |
| 5216 | | | |
| 5217 | | | if (context_data_len == 0) |
Event 5:
Taking true branch. context_data_len == 0 evaluates to true.
hide
|
|
| 5218 | | | continue; |
| 5219 | | | |
| 5220 | | | |
| 5221 | | | |
| 5222 | | | |
| 5223 | | | |
| 5224 | | | |
| 5225 | | | |
| 5226 | | | switch(scid) |
| 5227 | | | { |
| 5228 | | | case 0x01: |
| 5229 | | | decode_CodeSets(tvb, sub_tree1, offset, |
| 5230 | | | encapsulation_is_be, encapsulation_boundary); |
| 5231 | | | break; |
| 5232 | | | case 0x0a: |
| 5233 | | | decode_RTCorbaPriority(tvb, sub_tree1, offset, |
| 5234 | | | encapsulation_is_be, encapsulation_boundary); |
| 5235 | | | break; |
| 5236 | | | default: |
| 5237 | | | |
| 5238 | | | |
| 5239 | | | *offset = temp_offset1; |
| 5240 | | | decode_UnknownServiceContext(tvb, sub_tree1, offset, stream_is_be, |
| 5241 | | | boundary); |
| 5242 | | | break; |
| 5243 | | | } |
| 5244 | | | |
| 5245 | | | *offset = temp_offset1 + sizeof(context_data_len) + context_data_len; |
| 5246 | | | |
| 5247 | | | } |
| 5248 | | | |
| 5249 | | | if (tf) { |
Event 7:
Skipping " if". tf evaluates to false.
hide
|
|
| 5250 | | | if (*offset - start_offset <= 0) |
| 5251 | | | 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) |
| |
|
| 5252 | | | proto_item_set_len(tf, *offset - start_offset); |
| 5253 | | | } |
| 5254 | | | |
| 5255 | | | } |
| |