Text   |  XML   |  ReML   |   Visible Warnings:

Cast Alters Value  at packet-rtp.c:483

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);
expand/collapse

rtp_add_address

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-rtp.c)expand/collapse
Show more  
 526  void rtp_add_address(packet_info *pinfo,
 527                       address *addr, int port,
 528                       int other_port,
 529                       const gchar *setup_method, guint32 setup_frame_number, gboolean is_video , GHashTable *rtp_dyn_payload)
 530  {
 531[+]         srtp_add_address(pinfo, addr, port, other_port, setup_method, setup_frame_number, is_video, rtp_dyn_payload, NULL);
expand/collapse

srtp_add_address

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-rtp.c)expand/collapse
Show more  
 445  void srtp_add_address(packet_info *pinfo,
 446                       address *addr, int port,
 447                       int other_port,
 448                       const gchar *setup_method, guint32 setup_frame_number, gboolean is_video _U_, GHashTable *rtp_dyn_payload,
 449                       struct srtp_info *srtp_info)
 450  {
 451          address null_addr;
 452          conversation_t* p_conv;
 453          struct _rtp_conversation_info *p_conv_data = NULL;
 454   
 455          /*
 456           * If this isn't the first time this packet has been processed,
 457           * we've already done this work, so we don't need to do it
 458           * again.
 459           */
 460          if (pinfo->fd->flags.visited)
 461          {
 462                  return;
 463          }
 464   
 465  #ifdef DEBUG 
 466          printf("#%u: %srtp_add_address(%s, %u, %u, %s, %u\n", pinfo->fd->num, (srtp_info)?"s":"", address_to_str(addr), port, other_port, setup_method, setup_frame_number);
 467  #endif
 468   
 469          SET_ADDRESS(&null_addr, AT_NONE, 0, NULL);
 470   
 471          /*
 472           * Check if the ip address and port combination is not
 473           * already registered as a conversation.
 474           */
 475          p_conv = find_conversation( setup_frame_number, addr, &null_addr, PT_UDP, port, other_port,
 476[+]                                 NO_ADDR_B | (!other_port ? NO_PORT_B : 0));
 477   
 478          /*
 479           * If not, create a new conversation.
 480           */
 481          if ( !p_conv || p_conv->setup_frame != setup_frame_number) {
 482                  p_conv = conversation_new( setup_frame_number, addr, &null_addr, PT_UDP,
 483                                             (guint32)port, (guint32)other_port,
 484                                                                     NO_ADDR2 | (!other_port ? NO_PORT2 : 0));
Show more  
Show more  
Show more  




Change Warning 2931.30921 : Cast Alters Value

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

Priority:
State:
Finding:
Owner:
Note: