(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-isis-hello.c) |
| |
| 691 | | | dissect_hello_ptp_adj_clv(tvbuff_t *tvb, |
| 692 | | | proto_tree *tree, int offset, int id_length, int length) |
| 693 | | | { |
| 694 | | | static const value_string adj_state_vals[] = { |
| 695 | | | { 0, "Up" }, |
| 696 | | | { 1, "Initializing" }, |
| 697 | | | { 2, "Down" }, |
| 698 | | | { 0, NULL } |
| 699 | | | }; |
| 700 | | | guint8 adj_state; |
| 701 | | | const char *adj_state_str; |
| 702 | | | |
| 703 | | | adj_state = tvb_get_guint8(tvb, offset); |
| 704 | | | adj_state_str = val_to_str(adj_state, adj_state_vals, "Unknown (%u)"); |
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 |
|
| 705 | | | switch(length) { |
Event 2:
Executing default case.
hide
|
|
| 706 | | | case 1: |
| 707 | | | proto_tree_add_text ( tree, tvb, offset, 1, |
| 708 | | | "Adjacency State: %s", adj_state_str ); |
| 709 | | | break; |
| 710 | | | case 5: |
| 711 | | | proto_tree_add_text ( tree, tvb, offset, 1, |
| 712 | | | "Adjacency State: %s", adj_state_str ); |
| 713 | | | proto_tree_add_text ( tree, tvb, offset+1, 4, |
| 714 | | | "Extended Local circuit ID: 0x%08x", tvb_get_ntohl(tvb, offset+1) ); |
| 715 | | | break; |
| 716 | | | case 11: |
| 717 | | | proto_tree_add_text ( tree, tvb, offset, 1, |
| 718 | | | "Adjacency State: %s", adj_state_str ); |
| 719 | | | proto_tree_add_text ( tree, tvb, offset+1, 4, |
| 720 | | | "Extended Local circuit ID: 0x%08x", tvb_get_ntohl(tvb, offset+1) ); |
| 721 | | | proto_tree_add_text ( tree, tvb, offset+5, id_length, |
| 722 | | | "Neighbor SystemID: %s", |
| 723 | | | print_system_id( tvb_get_ptr(tvb, offset+5, id_length), id_length ) ); |
| 724 | | | break; |
| 725 | | | case 15: |
| 726 | | | proto_tree_add_text ( tree, tvb, offset, 1, |
| 727 | | | "Adjacency State: %s", adj_state_str ); |
| 728 | | | proto_tree_add_text ( tree, tvb, offset+1, 4, |
| 729 | | | "Extended Local circuit ID: 0x%08x", tvb_get_ntohl(tvb, offset+1) ); |
| 730 | | | proto_tree_add_text ( tree, tvb, offset+5, id_length, |
| 731 | | | "Neighbor SystemID: %s", |
| 732 | | | print_system_id( tvb_get_ptr(tvb, offset+5, id_length), id_length ) ); |
| 733 | | | proto_tree_add_text ( tree, tvb, offset+5+id_length, 4, |
| 734 | | | "Neighbor Extended Local circuit ID: 0x%08x", |
| 735 | | | tvb_get_ntohl(tvb, offset+5+id_length) ); |
| 736 | | | break; |
| 737 | | | default: |
| 738 | | | isis_dissect_unknown(tvb, tree, offset, |
| 739 | | | "malformed TLV (%d vs 1,5,11,15)", length ); |
| 740 | | | return; |
| 741 | | | } |
| 742 | | | } |
| |