Text   |  XML   |  ReML   |   Visible Warnings:

Null Pointer Dereference  at packet-wcp.c:575

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

wcp_uncompress

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-wcp.c)expand/collapse
Show more  
 473  static tvbuff_t *wcp_uncompress( tvbuff_t *src_tvb, int offset, packet_info *pinfo, proto_tree *tree) {
 474   
 475  /* do the packet data uncompression and load it into the dst buffer */
 476   
 477          proto_tree      *sub_tree;
 478          proto_item      *ti;
 479   
 480          int len=0, i = -1;
 481          int cnt = tvb_reported_length( src_tvb)-1;      /* don't include check byte */
 482   
 483          guint8 *dst, *src, *buf_start, *buf_end,  *tmp, comp_flag_bits = 0;
 484          guint8 src_buf[ MAX_WCP_BUF_LEN];
 485          tvbuff_t *volatile tvb = 0;
 486          wcp_window_t *buf_ptr = 0;
 487          wcp_pdata_t *volatile pdata_ptr;
 488          volatile gboolean bounds_error = FALSE;
 489           
 490          buf_ptr = get_wcp_window_ptr( pinfo);
 491   
 492          buf_start = buf_ptr->buffer;
 493          buf_end = buf_start + MAX_WIN_BUF_LEN;
 494          tmp = buf_ptr->buf_cur;
 495   
 496          if (cnt - offset > MAX_WCP_BUF_LEN) {
 497                  if (tree)
 498                          proto_tree_add_text( tree, src_tvb, offset, -1,
 499                                  "Compressed data exceeds maximum buffer length (%d > %d)",
 500                                  cnt - offset, MAX_WCP_BUF_LEN);
 501                  return NULL;
 502          }
 503   
 504          src = tvb_memcpy(src_tvb, src_buf, offset, cnt - offset);
 505          dst = buf_ptr->buf_cur;
 506   
 507          while( offset++ < cnt){
 508   
 509                  if ( --i >= 0){
 510                          if ( comp_flag_bits & 0x80){    /* if this is a compressed entry */
 511   
 512                                  if ( !pinfo->fd->flags.visited){        /* if first pass */
 513                                          dst = decompressed_entry( src, dst, &len, buf_start, buf_end);
 514                                  }
 515                                  if ((*src & 0xf0) == 0x10){
 516                                          if ( tree) {
 517                                                  ti = proto_tree_add_item( tree, hf_wcp_long_run, src_tvb,
 518
558
Show [ Lines 518 to 558 omitted. ]
 559   
 560                          comp_flag_bits = *src++;
 561                          if (tree)
 562                                  proto_tree_add_uint( tree, hf_wcp_comp_bits,  src_tvb, offset-1, 1,
 563                                          comp_flag_bits);
 564   
 565                          i = 8;
 566                  }
 567          }
 568   
 569          if ( pinfo->fd->flags.visited){ /* if not first pass */
 570                                          /* get uncompressed data */
 571[+]                 pdata_ptr = p_get_proto_data( pinfo->fd, proto_wcp);
 572   
 573                  if ( !pdata_ptr)        /* exit if no data */
 574                          return NULL;
 575                  len = pdata_ptr->len;
Show more  




Change Warning 3055.32243 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: