(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-rtse.c) |
| |
| 697 | | | dissect_rtse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) |
| 698 | | | { |
| 699 | | | int offset = 0; |
| 700 | | | int old_offset; |
| 701 | | | proto_item *item=NULL; |
| 702 | | | proto_tree *tree=NULL; |
| 703 | | | proto_tree *next_tree=NULL; |
| 704 | | | tvbuff_t *next_tvb = NULL; |
| 705 | | | tvbuff_t *data_tvb = NULL; |
| 706 | | | fragment_data *frag_msg = NULL; |
| 707 | | | guint32 fragment_length; |
| 708 | | | guint32 rtse_id = 0; |
| 709 | | | gboolean data_handled = FALSE; |
| 710 | | | conversation_t *conversation = NULL; |
| 711 | | | asn1_ctx_t asn1_ctx; |
| 712 | | | asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); |
| 713 | | | |
| 714 | | | |
| 715 | | | top_tree=parent_tree; |
| 716 | | | |
| 717 | | | |
| 718 | | | if( !pinfo->private_data ){ |
| 719 | | | if(parent_tree){ |
| 720 | | | proto_tree_add_text(parent_tree, tvb, offset, -1, |
| 721 | | | "Internal error:can't get application context from ACSE dissector."); |
| 722 | | | } |
| 723 | | | return ; |
| 724 | | | } else { |
| 725 | | | session = ( (struct SESSION_DATA_STRUCTURE*)(pinfo->private_data) ); |
| 726 | | | |
| 727 | | | } |
| 728 | | | |
| 729 | | | if (check_col(pinfo->cinfo, COL_PROTOCOL)) |
| 730 | | | col_set_str(pinfo->cinfo, COL_PROTOCOL, "RTSE"); |
| 731 | | | if (check_col(pinfo->cinfo, COL_INFO)) |
| 732 | | | col_clear(pinfo->cinfo, COL_INFO); |
| 733 | | | |
| 734 | | | if (rtse_reassemble && |
| 735 | | | ((session->spdu_type == SES_DATA_TRANSFER) || |
| 736 | | | (session->spdu_type == SES_MAJOR_SYNC_POINT))) { |
| 737 | | | |
| 738 | | | conversation = find_conversation (pinfo->fd->num, |
| 739 | | | &pinfo->src, &pinfo->dst, pinfo->ptype, |
| 740 | | | pinfo->srcport, pinfo->destport, 0); |
| 741 | | | if (conversation != NULL) { |
| 742 | | | rtse_id = conversation->index; |
| 743 | | | } |
| 744 | | | session->rtse_reassemble = TRUE; |
| 745 | | | } |
| 746 | | | if (rtse_reassemble && session->spdu_type == SES_MAJOR_SYNC_POINT) { |
| 747 | | | frag_msg = fragment_end_seq_next (pinfo, rtse_id, rtse_segment_table, |
| 748 | | | rtse_reassembled_table); |
| 749 | | | next_tvb = process_reassembled_data (tvb, offset, pinfo, "Reassembled RTSE", |
| 750 | | | frag_msg, &rtse_frag_items, NULL, parent_tree); |
| 751 | | | } |
| 752 | | | if(parent_tree){ |
| 753 | | | item = proto_tree_add_item(parent_tree, proto_rtse, next_tvb ? next_tvb : tvb, 0, -1, FALSE); |
| 754 | | | tree = proto_item_add_subtree(item, ett_rtse); |
| 755 | | | } |
| 756 | | | if (rtse_reassemble && session->spdu_type == SES_DATA_TRANSFER) { |
| 757 | | | |
| 758 | | | dissect_ber_octet_string(FALSE, &asn1_ctx, NULL, tvb, offset, 0, &data_tvb); |
Ignored Return Value
The return value of dissect_ber_octet_string() 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 dissect_ber_octet_string() 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 dissect_ber_octet_string() from the Ignored Return Value check, use configuration file parameter RETURN_CHECKER_IGNORED_FUNCS).
Show: All events | Only primary events |
|
| 759 | | | |
| 760 | | | if (data_tvb) { |
Event 2:
Taking true branch. data_tvb evaluates to true.
hide
|
|
| 761 | | | fragment_length = tvb_length_remaining (data_tvb, 0); |
| 762 | | | proto_tree_add_text(tree, data_tvb, 0, (fragment_length) ? -1 : 0, |
Event 4:
fragment_length evaluates to false.
hide
|
|
| 763 | | | "RTSE segment data (%u byte%s)", fragment_length, |
| 764 | | | plurality(fragment_length, "", "s")); |
Event 3:
fragment_length == 1 evaluates to false.
hide
|
|
| 765 | | | frag_msg = fragment_add_seq_next (data_tvb, 0, pinfo, |
| 766 | | | rtse_id, rtse_segment_table, |
| 767 | | | rtse_reassembled_table, fragment_length, TRUE); |
Event 5:
!0 evaluates to true.
hide
|
|
| 768 | | | if (frag_msg && pinfo->fd->num != frag_msg->reassembled_in) { |
| 769 | | | |
| 770 | | | proto_tree_add_uint (tree, *(rtse_frag_items.hf_reassembled_in), |
| 771 | | | data_tvb, 0, 0, frag_msg->reassembled_in); |
| 772 | | | } |
| 773 | | | pinfo->fragmented = TRUE; |
Event 7:
!0 evaluates to true.
hide
|
|
| 774 | | | data_handled = TRUE; |
Event 8:
!0 evaluates to true.
hide
|
|
| 775 | | | } else { |
| 776 | | | fragment_length = tvb_length_remaining (tvb, offset); |
| 777 | | | } |
| 778 | | | |
| 779 | | | if (check_col(pinfo->cinfo, COL_INFO)) |
Event 9:
Taking true branch. check_col(...) evaluates to true.
hide
|
|
| 780 | | | col_append_fstr(pinfo->cinfo, COL_INFO, "[RTSE fragment, %u byte%s]", |
| 781 | | | fragment_length, plurality(fragment_length, "", "s")); |
Event 10:
fragment_length == 1 evaluates to false.
hide
|
|
| 782 | | | } else if (rtse_reassemble && session->spdu_type == SES_MAJOR_SYNC_POINT) { |
| 783 | | | if (next_tvb) { |
| 784 | | | |
| 785 | | | session->ros_op = (ROS_OP_INVOKE | ROS_OP_ARGUMENT); |
| 786 | | | offset=dissect_ber_external_type(FALSE, tree, next_tvb, 0, &asn1_ctx, -1, call_rtse_external_type_callback); |
| 787 | | | } else { |
| 788 | | | offset = tvb_length (tvb); |
| 789 | | | } |
| 790 | | | pinfo->fragmented = FALSE; |
| 791 | | | data_handled = TRUE; |
| 792 | | | } |
| 793 | | | |
| 794 | | | if (!data_handled) { |
Event 11:
Skipping " if". data_handled evaluates to true.
hide
|
|
| 795 | | | while (tvb_reported_length_remaining(tvb, offset) > 0){ |
| 796 | | | old_offset=offset; |
| 797 | | | offset=dissect_rtse_RTSE_apdus(TRUE, tvb, offset, &asn1_ctx, tree, -1); |
| 798 | | | if(offset == old_offset){ |
| 799 | | | item = proto_tree_add_text(tree, tvb, offset, -1, "Unknown RTSE PDU"); |
| 800 | | | |
| 801 | | | if(item){ |
| 802 | | | expert_add_info_format (pinfo, item, PI_UNDECODED, PI_WARN, "Unknown RTSE PDU"); |
| 803 | | | next_tree=proto_item_add_subtree(item, ett_rtse_unknown); |
| 804 | | | dissect_unknown_ber(pinfo, tvb, offset, next_tree); |
| 805 | | | } |
| 806 | | | |
| 807 | | | offset = tvb_length(tvb); |
| 808 | | | break; |
| 809 | | | } |
| 810 | | | } |
| 811 | | | } |
| 812 | | | |
| 813 | | | top_tree = NULL; |
| 814 | | | } |
| |