Text   |  XML   |  ReML   |   Visible Warnings:

Null Test After Dereference  at packet-l1-events.c:93

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

dissect_l1_events

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




Change Warning 12386.32344 : Null Test After Dereference

Priority:
State:
Finding:
Owner:
Note: