Text   |  XML   |  ReML   |   Visible Warnings:

Null Test After Dereference  at packet-text-media.c:82

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

dissect_text_lines

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-text-media.c)expand/collapse
Show more  
 60  dissect_text_lines(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 61  {
 62          proto_tree      *subtree;
 63          proto_item      *ti;
 64          gint            offset = 0, next_offset;
 65          gint            len;
 66          const char      *data_name;
 67   
 68          data_name = pinfo->match_string;
 69          if (! (data_name && data_name[0])) {
 70                  /*
 71                   * No information from "match_string"
 72                   */
 73                  data_name = (char *)(pinfo->private_data);
 74                  if (! (data_name && data_name[0])) {
 75                          /*
 76                           * No information from "private_data"
 77                           */
 78                          data_name = NULL;
 79                  }
 80          }
 81   
 82          if (data_name && check_col(pinfo->cinfo, COL_INFO))
 83                  col_append_sep_fstr(pinfo->cinfo, COL_INFO, " ", "(%s)",
 84                                  data_name);
 85   
 86          if (tree) {
 87                  ti = proto_tree_add_item(tree, proto_text_lines,
 88                                  tvb, 0, -1, FALSE);
 89                  if (data_name)
 90                          proto_item_append_text(ti, ": %s", data_name);
 91                  subtree = proto_item_add_subtree(ti, ett_text_lines);
 92                  /* Read the media line by line */
 93                  while (tvb_reported_length_remaining(tvb, offset) != 0) {
 94                          /*
 95                           * XXX - we need to be passed the parameters 
 96                           * of the content type via "pinfo->private_data",
 97                           * so that we know the character set.  We'd
 98                           * have to handle that character set, which 
 99                           * might be a multibyte character set such 
 100                           * as "iso-10646-ucs-2", or might require other
 101                           * special processing.
 102                           */
 103                          len = tvb_find_line_end(tvb, offset,
 104                                          tvb_ensure_length_remaining(tvb, offset),
 105                                          &next_offset, FALSE);
 106                          if (len == -1)
 107                                  break;
 108   
 109                          /* We use next_offset - offset instead of len in the
 110                           * call to tvb_format_text() so it will include the 
 111                           * line terminator(s) (\r and/or \n) in the display.
 112                           */
 113                          proto_tree_add_text(subtree, tvb, offset, next_offset - offset,
 114                                              "%s", tvb_format_text(tvb, offset,
 115                                                                    next_offset - offset));
 116                          offset = next_offset;
 117                  }
 118          }
 119  }
Show more  




Change Warning 12388.32686 : Null Test After Dereference

Priority:
State:
Finding:
Owner:
Note: