Text   |  XML   |  ReML   |   Visible Warnings:

Type Underrun  at packet-rtsp.c:453

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                          return;
 409                  }
 410                   
 411                  /* Move tmp to beyone interleaved string */
 412                  tmp += strlen(rtsp_inter);
 413                  /* Look for channel number(s) */
 414                  i = sscanf(tmp, "%u-%u", &s_data_chan, &s_mon_chan);
 415                  if (i < 1)
 416                  {
 417                          g_warning("Frame %u: rtsp: bad interleaved", pinfo->fd->num);
 418                          return;
 419                  }
 420                   
 421                  /* At least data channel present, look for conversation (presumably TCP) */
 422                  conv = find_conversation(pinfo->fd->num, &pinfo->src, &pinfo->dst, pinfo->ptype,
 423[+]                                          pinfo->srcport, pinfo->destport, 0);
 424   
 425                  /* Create new conversation if necessary */
 426                  if (!conv)
 427                  {
 428                          conv = conversation_new(pinfo->fd->num, &pinfo->src, &pinfo->dst,
 429                                                  pinfo->ptype, pinfo->srcport, pinfo->destport,
 430                                                  0);
 431                  }
 432                   
 433                  /* Look for previous data */
 434                  data = conversation_get_proto_data(conv, proto_rtsp);
 435   
 436                  /* Create new data if necessary */
 437                  if (!data)
 438                  {
 439[+]                         data = se_alloc(sizeof(rtsp_conversation_data_t));
 440                          conversation_add_proto_data(conv, proto_rtsp, data);
 441                  }
 442   
 443                  /* Now set the dissector handle of the interleaved channel 
 444                     according to the transport protocol used */
 445                  if (rtp_transport)
 446                  {
 447                          if (s_data_chan < RTSP_MAX_INTERLEAVED) {
 448                                  data->interleaved[s_data_chan].dissector =
 449                                          rtp_handle;
 450                          }
 451                          if (i > 1 && s_mon_chan < RTSP_MAX_INTERLEAVED) {
 452                                  data->interleaved[s_mon_chan].dissector =
 453                                          rtcp_handle;
Show more  




Change Warning 2936.30926 : Type Underrun

Priority:
State:
Finding:
Owner:
Note: