(/home/sate/Testcases/c/cve/wireshark-1.2.0/gtk/iax2_analysis.c) |
| |
| 694 | | | static int iax2_packet_save_payload(tap_iax2_save_info_t *saveinfo, |
| 695 | | | tap_iax2_stat_t *statinfo, |
| 696 | | | packet_info *pinfo, |
| 697 | | | const struct _iax2_info_t *iax2info) |
| 698 | | | { |
| 699 | | | const guint8 *data; |
| 700 | | | size_t nchars; |
| 701 | | | |
| 702 | | | |
| 703 | | | if (statinfo->flags & STAT_FLAG_FIRST) { |
| 704 | | | if (saveinfo->fp == NULL) { |
| 705 | | | saveinfo->saved = FALSE; |
| 706 | | | saveinfo->error_type = TAP_RTP_FILE_OPEN_ERROR; |
| 707 | | | } |
| 708 | | | else |
| 709 | | | saveinfo->saved = TRUE; |
| 710 | | | } |
| 711 | | | |
| 712 | | | |
| 713 | | | |
| 714 | | | if (saveinfo->saved == FALSE) |
| 715 | | | return 0; |
| 716 | | | |
| 717 | | | |
| 718 | | | if (pinfo->fd->pkt_len != pinfo->fd->cap_len) { |
| 719 | | | saveinfo->saved = FALSE; |
| 720 | | | saveinfo->error_type = TAP_RTP_WRONG_LENGTH; |
| 721 | | | return 0; |
| 722 | | | } |
| 723 | | | |
| 724 | | | if (iax2info->payload_len > 0) { |
| 725 | | | data = iax2info->payload_data; |
| 726 | | | nchars=fwrite(data, sizeof(unsigned char), iax2info->payload_len, saveinfo->fp); |
Unused Value
The value assigned to nchars is never subsequently used on any execution path. |
|
| 727 | | | saveinfo->count+=iax2info->payload_len; |
| 728 | | | |
| 729 | | | fflush(saveinfo->fp); |
| 730 | | | saveinfo->saved = TRUE; |
| 731 | | | return 0; |
| 732 | | | } |
| 733 | | | |
| 734 | | | return 0; |
| 735 | | | } |
| |