(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-sip.c) |
| |
| 3573 | | | guint sip_find_invite(packet_info *pinfo, |
| 3574 | | | gchar *cseq_method _U_, |
| 3575 | | | gchar *call_id, |
| 3576 | | | guchar cseq_number_set, |
| 3577 | | | guint32 cseq_number _U_, |
| 3578 | | | guint32 *response_time) |
| 3579 | | | { |
| 3580 | | | guint32 cseq_to_compare = 0; |
| 3581 | | | sip_hash_key key; |
| 3582 | | | sip_hash_value *p_val = 0; |
| 3583 | | | sip_frame_result_value *sip_frame_result = NULL; |
| 3584 | | | guint result = 0; |
| 3585 | | | gint seconds_between_packets; |
| 3586 | | | gint nseconds_between_packets; |
| 3587 | | | |
| 3588 | | | |
| 3589 | | | if (pinfo->ptype != PT_UDP) |
| 3590 | | | { |
| 3591 | | | return 0; |
| 3592 | | | } |
| 3593 | | | |
| 3594 | | | |
| 3595 | | | if (pinfo->in_error_pkt) |
| 3596 | | | { |
| 3597 | | | return 0; |
| 3598 | | | } |
| 3599 | | | |
| 3600 | | | |
| 3601 | | | if (!cseq_number_set) |
| 3602 | | | { |
| 3603 | | | return 0; |
| 3604 | | | } |
| 3605 | | | |
| 3606 | | | |
| 3607 | | | if (pinfo->fd->flags.visited) |
| 3608 | | | { |
| 3609 | | | sip_frame_result = (sip_frame_result_value*)p_get_proto_data(pinfo->fd, proto_sip); |
| 3610 | | | if (sip_frame_result != NULL) |
| 3611 | | | { |
| 3612 | | | *response_time = sip_frame_result->response_time; |
| 3613 | | | return sip_frame_result->response_request_frame_num; |
| 3614 | | | } |
| 3615 | | | else |
| 3616 | | | { |
| 3617 | | | return 0; |
| 3618 | | | } |
| 3619 | | | } |
| 3620 | | | |
| 3621 | | | |
| 3622 | | | |
| 3623 | | | |
| 3624 | | | g_strlcpy(key.call_id, call_id, MAX_CALL_ID_SIZE); |
| 3625 | | | |
| 3626 | | | |
| 3627 | | | SET_ADDRESS(&key.dest_address, pinfo->net_dst.type, pinfo->net_dst.len,
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/address.h |
| |
66 | #define SET_ADDRESS(addr, addr_type, addr_len, addr_data) { \ |
67 | (addr)->type = (addr_type); \ |
68 | (addr)->len = (addr_len); \ |
69 | (addr)->data = (addr_data); \ |
70 | } |
| |
|
| 3628 | | | pinfo->net_dst.data); |
| 3629 | | | SET_ADDRESS(&key.source_address, pinfo->net_src.type, pinfo->net_src.len,
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/address.h |
| |
66 | #define SET_ADDRESS(addr, addr_type, addr_len, addr_data) { \ |
67 | (addr)->type = (addr_type); \ |
68 | (addr)->len = (addr_len); \ |
69 | (addr)->data = (addr_data); \ |
70 | } |
| |
|
| 3630 | | | pinfo->net_src.data); |
| 3631 | | | key.dest_port = pinfo->destport; |
| 3632 | | | key.source_port = pinfo->srcport; |
| 3633 | | | |
| 3634 | | | |
| 3635 | | | p_val = (sip_hash_value*)g_hash_table_lookup(sip_hash, &key); |
| 3636 | | | |
| 3637 | | | if (p_val) |
| 3638 | | | { |
| 3639 | | | |
| 3640 | | | cseq_to_compare = p_val->cseq; |
Unused Value
The value assigned to cseq_to_compare is never subsequently used on any execution path. |
|
| 3641 | | | } |
| 3642 | | | else |
| 3643 | | | { |
| 3644 | | | |
| 3645 | | | return 0; |
| 3646 | | | } |
| 3647 | | | |
| 3648 | | | |
| 3649 | | | |
| 3650 | | | |
| 3651 | | | #if 0 |
| 3652 | | | if ((cseq_number == cseq_to_compare) && |
| 3653 | | | (p_val->transaction_state == request_seen) && |
| 3654 | | | (strcmp(cseq_method, p_val->method) == 0)) |
| 3655 | | | { |
| 3656 | | | result = p_val->frame_number; |
| 3657 | | | } |
| 3658 | | | #endif |
| 3659 | | | |
| 3660 | | | result = p_val->frame_number; |
| 3661 | | | |
| 3662 | | | |
| 3663 | | | sip_frame_result = p_get_proto_data(pinfo->fd, proto_sip); |
| 3664 | | | if (sip_frame_result == NULL) |
| 3665 | | | { |
| 3666 | | | |
| 3667 | | | sip_frame_result = se_alloc0(sizeof(sip_frame_result_value)); |
| 3668 | | | } |
| 3669 | | | |
| 3670 | | | sip_frame_result->response_request_frame_num = result; |
| 3671 | | | |
| 3672 | | | |
| 3673 | | | seconds_between_packets = (gint) |
| 3674 | | | (pinfo->fd->abs_ts.secs - p_val->request_time.secs); |
| 3675 | | | nseconds_between_packets = |
| 3676 | | | pinfo->fd->abs_ts.nsecs - p_val->request_time.nsecs; |
| 3677 | | | sip_frame_result->response_time = (seconds_between_packets*1000) + |
| 3678 | | | (nseconds_between_packets / 1000000); |
| 3679 | | | *response_time = sip_frame_result->response_time; |
| 3680 | | | |
| 3681 | | | p_add_proto_data(pinfo->fd, proto_sip, sip_frame_result); |
| 3682 | | | |
| 3683 | | | return result; |
| 3684 | | | } |
| |