(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-iapp.c) |
| |
| 411 | | | dissect_iapp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) |
| 412 | | | { |
| 413 | | | proto_item *ti, *pdutf; |
| 414 | | | proto_tree *iapp_tree, *pdutree; |
| 415 | | | e_iapphdr ih; |
| 416 | | | int ia_version; |
| 417 | | | int ia_type; |
| 418 | | | const gchar *codestrval; |
| 419 | | | |
| 420 | | | if (check_col(pinfo->cinfo, COL_PROTOCOL)) |
| 421 | | | col_set_str(pinfo->cinfo, COL_PROTOCOL, "IAPP"); |
| 422 | | | |
| 423 | | | if (check_col(pinfo->cinfo, COL_INFO)) |
| 424 | | | col_clear(pinfo->cinfo, COL_INFO); |
| 425 | | | |
| 426 | | | tvb_memcpy(tvb, (guint8 *)&ih, 0, sizeof(e_iapphdr)); |
| 427 | | | |
| 428 | | | ia_version = (int)ih.ia_version; |
| 429 | | | ia_type = (int)ih.ia_type; |
| 430 | | | codestrval = val_to_str(ia_type, iapp_vals, "Unknown Packet"); |
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 |
|
| 431 | | | if (check_col(pinfo->cinfo, COL_INFO)) |
Event 2:
Skipping " if". check_col(...) evaluates to false.
hide
|
|
| 432 | | | { |
| 433 | | | col_add_fstr(pinfo->cinfo, COL_INFO, "%s(%d) (version=%d)", |
| 434 | | | codestrval, ia_type, ia_version); |
| 435 | | | } |
| 436 | | | |
| 437 | | | if (tree) |
Event 3:
Skipping " if". tree evaluates to false.
hide
|
|
| 438 | | | { |
| 439 | | | ti = proto_tree_add_item(tree, proto_iapp, tvb, 0, -1, FALSE); |
| 440 | | | iapp_tree = proto_item_add_subtree(ti, ett_iapp); |
| 441 | | | |
| 442 | | | |
| 443 | | | |
| 444 | | | proto_tree_add_uint(iapp_tree, hf_iapp_version, tvb, 0, 1, |
| 445 | | | ih.ia_version); |
| 446 | | | proto_tree_add_uint_format(iapp_tree, hf_iapp_type, tvb, 1, 1, |
| 447 | | | ih.ia_type, "Type: %s(%d)", codestrval, ia_type); |
| 448 | | | |
| 449 | | | pdutf = proto_tree_add_text(iapp_tree, tvb, 2, -1, |
| 450 | | | "Protocol data units"); |
| 451 | | | pdutree = proto_item_add_subtree(pdutf, ett_iapp_pdu); |
| 452 | | | |
| 453 | | | if (pdutree) |
| 454 | | | { |
| 455 | | | dissect_pdus(tvb, 2, pdutree, |
| 456 | | | tvb_length_remaining(tvb, 2)); |
| 457 | | | } |
| 458 | | | } |
| 459 | | | } |
| |