(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-dcerpc-nt.c) |
| |
| 215 | | | static void cb_byte_array_postprocess(packet_info *pinfo, proto_tree *tree _U_, |
| 216 | | | proto_item *item, tvbuff_t *tvb, |
| 217 | | | int start_offset, int end_offset, |
| 218 | | | void *callback_args) |
| 219 | | | { |
| 220 | | | gint options = GPOINTER_TO_INT(callback_args); |
| 221 | | | gint levels = CB_STR_ITEM_LEVELS(options); |
| 222 | | | char *s; |
| 223 | | | |
| 224 | | | |
| 225 | | | |
| 226 | | | if (start_offset % 4) |
| 227 | | | start_offset += 4 - (start_offset % 4); |
| 228 | | | |
| 229 | | | |
| 230 | | | |
| 231 | | | if ((end_offset - start_offset) <= 12) |
| 232 | | | return; |
| 233 | | | |
| 234 | | | s = tvb_bytes_to_str( |
| 235 | | | tvb, start_offset + 12, (end_offset - start_offset - 12) ); |
Ignored Return Value
The return value of tvb_bytes_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 tvb_bytes_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 tvb_bytes_to_str() from the Ignored Return Value check, use configuration file parameter RETURN_CHECKER_IGNORED_FUNCS).
Show: All events | Only primary events |
|
| 236 | | | |
| 237 | | | |
| 238 | | | |
| 239 | | | if (options & CB_STR_COL_INFO) { |
Event 2:
Taking true branch. options & 268435456 evaluates to true.
hide
|
|
| 240 | | | if (check_col(pinfo->cinfo, COL_INFO)) |
Event 3:
Skipping " if". check_col(...) evaluates to false.
hide
|
|
| 241 | | | col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", s); |
| 242 | | | } |
| 243 | | | |
| 244 | | | |
| 245 | | | |
| 246 | | | if (levels > 0 && item && s && s[0]) { |
Event 4:
Skipping " if". - levels > 0 evaluates to true.
- item evaluates to false.
hide
|
|
| 247 | | | proto_item_append_text(item, ": %s", s); |
| 248 | | | item = item->parent; |
| 249 | | | levels--; |
| 250 | | | if (levels > 0) { |
| 251 | | | proto_item_append_text(item, ": %s", s); |
| 252 | | | item = item->parent; |
| 253 | | | levels--; |
| 254 | | | while (levels > 0) { |
| 255 | | | proto_item_append_text(item, " %s", s); |
| 256 | | | item = item->parent; |
| 257 | | | levels--; |
| 258 | | | } |
| 259 | | | } |
| 260 | | | } |
| 261 | | | } |
| |