Text   |  XML   |  ReML   |   Visible Warnings:

Cast Alters Value  at packet-rtcp.c:538

No properties have been set. | edit properties
Jump to warning location ↓ warning details...
Show Events | Options

rtsp_create_conversation

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-rtsp.c)expand/collapse
Show more  
 334  rtsp_create_conversation(packet_info *pinfo, const guchar *line_begin,
 335                           size_t line_len, gint rdt_feature_level)
 336  {
 337          conversation_t  *conv;
 338          guchar          buf[256];
 339          guchar          *tmp;
 340          gboolean        rtp_transport = FALSE;
 341          gboolean        rdt_transport = FALSE;
 342          guint           c_data_port, c_mon_port;
 343          guint           s_data_port, s_mon_port;
 344          gboolean        is_video = FALSE; /* FIX ME - need to indicate video or not */
 345   
 346          /* Copy line into buf */
 347          if (line_len > sizeof(buf) - 1)
 348          {
 349                  /* Don't overflow the buffer. */
 350                  line_len = sizeof(buf) - 1;
 351          }
 352          memcpy(buf, line_begin, line_len);
 353          buf[line_len] = '\0';
 354   
 355          /* Get past "Transport:" and spaces */  
 356          tmp = buf + STRLEN_CONST(rtsp_transport);
 357          while (*tmp && isspace(*tmp))
 358                  tmp++;
 359   
 360          /* Work out which transport type is here */
 361          if (g_ascii_strncasecmp(tmp, rtsp_rtp, strlen(rtsp_rtp)) == 0)
 362                  rtp_transport = TRUE;
 363          else 
 364          if (g_ascii_strncasecmp(tmp, rtsp_real_rdt, strlen(rtsp_real_rdt)) == 0 ||
 365              g_ascii_strncasecmp(tmp, rtsp_real_tng, strlen(rtsp_real_tng)) == 0)
 366                  rdt_transport = TRUE;
 367          else 
 368          {
 369                  /* Give up on unknown transport types */
 370                  return;
 371          }
 372           
 373          c_data_port = c_mon_port = 0;
 374          s_data_port = s_mon_port = 0;
 375           
 376          /* Look for server port */
 377          if ((tmp = strstr(buf, rtsp_sps))) {
 378                  tmp += strlen(rtsp_sps);
 379                  if (sscanf(tmp, "%u-%u", &s_data_port, &s_mon_port) < 1) {
 380                          g_warning("Frame %u: rtsp: bad server_port",
 381                                  pinfo->fd->num);
 382                          return;
 383                  }
 384          }
 385          /* Look for client port */
 386          if ((tmp = strstr(buf, rtsp_cps))) {
 387                  tmp += strlen(rtsp_cps);
 388                  if (sscanf(tmp, "%u-%u", &c_data_port, &c_mon_port) < 1) {
 389                          g_warning("Frame %u: rtsp: bad client_port",
 390                                  pinfo->fd->num);
 391                          return;
 392                  }
 393          }
 394           
 395           
 396          /* Deal with RTSP TCP-interleaved conversations. */
 397          if (!c_data_port) {
 398                  rtsp_conversation_data_t        *data;
 399                  guint                           s_data_chan, s_mon_chan;
 400                  int                             i;
 401   
 402                  /* Search tranport line for interleaved string */
 403                  if ((tmp = strstr(buf, rtsp_inter)) == NULL) {
 404                          /*
 405                           * No interleaved or server_port - probably a
 406                           * SETUP request, rather than reply.
 407                           */
 408
462
Show [ Lines 408 to 462 omitted. ]
 463                  return;
 464          }
 465   
 466          /*
 467           * We only want to match on the destination address, not the
 468           * source address, because the server might send back a packet
 469           * from an address other than the address to which its client 
 470           * sent the packet, so we construct a conversation with no 
 471           * second address.
 472           */
 473          if (rtp_transport)
 474          {
 475                  /* There is always data for RTP */
 476                  rtp_add_address(pinfo, &pinfo->dst, c_data_port, s_data_port,
 477                                  "RTSP", pinfo->fd->num, is_video, NULL);
 478           
 479                  /* RTCP only if indicated */
 480                  if (c_mon_port)
 481                  {
 482                          rtcp_add_address(pinfo, &pinfo->dst, c_mon_port, s_mon_port,
 483[+]                                          "RTSP", pinfo->fd->num);
expand/collapse

rtcp_add_address

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-rtcp.c)expand/collapse
Show more  
 574  void rtcp_add_address( packet_info *pinfo,
 575                         address *addr, int port,
 576                         int other_port,
 577                         const gchar *setup_method, guint32 setup_frame_number)
 578  {
 579[+]         srtcp_add_address(pinfo, addr, port, other_port, setup_method, setup_frame_number, NULL);
expand/collapse

srtcp_add_address

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-rtcp.c)expand/collapse
Show more  
 500  void srtcp_add_address( packet_info *pinfo,
 501                         address *addr, int port,
 502                         int other_port,
 503                         const gchar *setup_method, guint32 setup_frame_number,
 504                         struct srtp_info *srtcp_info)
 505  {
 506          address null_addr;
 507          conversation_t* p_conv;
 508          struct _rtcp_conversation_info *p_conv_data = NULL;
 509   
 510          /*
 511           * If this isn't the first time this packet has been processed,
 512           * we've already done this work, so we don't need to do it
 513           * again.
 514           */
 515          if (pinfo->fd->flags.visited)
 516          {
 517                  return;
 518          }
 519   
 520  #ifdef DEBUG 
 521          printf("#%u: %srtcp_add_address(%s, %u, %u, %s, %u\n", pinfo->fd->num, (srtcp_info)?"s":"", address_to_str(addr), port, other_port, setup_method, setup_frame_number);
 522  #endif
 523   
 524          SET_ADDRESS(&null_addr, AT_NONE, 0, NULL);
 525   
 526          /*
 527           * Check if the ip address and port combination is not
 528           * already registered as a conversation.
 529           */
 530          p_conv = find_conversation( pinfo->fd->num, addr, &null_addr, PT_UDP, port, other_port,
 531[+]                                     NO_ADDR_B | (!other_port ? NO_PORT_B : 0));
 532   
 533          /*
 534           * If not, create a new conversation.
 535           */
 536          if ( ! p_conv ) {
 537                  p_conv = conversation_new( pinfo->fd->num, addr, &null_addr, PT_UDP,
 538                                             (guint32)port, (guint32)other_port,
 539                                             NO_ADDR2 | (!other_port ? NO_PORT2 : 0));
Show more  
Show more  
Show more  




Change Warning 2932.30922 : Cast Alters Value

Because they are very similar, this warning shares annotations with warning 2932.30931.

Priority:
State:
Finding:
Owner:
Note: