Text   |  XML   |  ReML   |   Visible Warnings:

Null Pointer Dereference  at packet-frame.c:236

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

dissect_frame

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-frame.c)expand/collapse
Show more  
 115  dissect_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
 116  {
 117          proto_tree      *fh_tree=NULL;
 118          proto_item      *volatile ti = NULL;
 119          nstime_t        ts;
 120          int             cap_len = 0, frame_len = 0;
 121          proto_tree      *volatile tree;
 122          proto_item  *item;
 123          guint32 frame_number;
 124   
 125          frame_number=pinfo->fd->num; /* dummy so that the buildbot crashdumps
 126                                          will show the packetnumber where the
 127                                          crash occurred.
 128                                       */
 129          tree=parent_tree;
 130   
 131          pinfo->current_proto = "Frame";
 132   
 133          if (pinfo->pseudo_header != NULL) {
 134                  switch (pinfo->fd->lnk_t) {
 135   
 136                  case WTAP_ENCAP_WFLEET_HDLC:
 137                  case WTAP_ENCAP_CHDLC_WITH_PHDR:
 138                  case WTAP_ENCAP_PPP_WITH_PHDR:
 139                  case WTAP_ENCAP_SDLC:
 140                  case WTAP_ENCAP_BLUETOOTH_H4:
 141                  case WTAP_ENCAP_BLUETOOTH_H4_WITH_PHDR:
 142                          pinfo->p2p_dir = pinfo->pseudo_header->p2p.sent ?
 143                              P2P_DIR_SENT : P2P_DIR_RECV;
 144                          break;
 145   
 146                  case WTAP_ENCAP_BLUETOOTH_HCI:
 147                          pinfo->p2p_dir = pinfo->pseudo_header->bthci.sent;
 148                          break;
 149   
 150                  case WTAP_ENCAP_LAPB:
 151                  case WTAP_ENCAP_FRELAY_WITH_PHDR:
 152                          pinfo->p2p_dir =
 153                              (pinfo->pseudo_header->x25.flags & FROM_DCE) ?
 154                              P2P_DIR_RECV : P2P_DIR_SENT;
 155
173
Show [ Lines 155 to 173 omitted. ]
 174   
 175                  case WTAP_ENCAP_GSM_UM:
 176                          pinfo->p2p_dir = pinfo->pseudo_header->gsm_um.uplink ?
 177                              P2P_DIR_SENT : P2P_DIR_RECV;
 178                          break;
 179   
 180                  }
 181          }
 182   
 183          /* Put in frame header information. */
 184          if (tree) {
 185            cap_len = tvb_length(tvb);
 186            frame_len = tvb_reported_length(tvb);
 187   
 188            ti = proto_tree_add_protocol_format(tree, proto_frame, tvb, 0, -1,
 189              "Frame %u (%u bytes on wire, %u bytes captured)", pinfo->fd->num, frame_len, cap_len);
 190   
 191            fh_tree = proto_item_add_subtree(ti, ett_frame);
 192          }
 193   
 194          /* if FRAME is not referenced from any filters we dont need to worry about
 195             generating any tree items.  We must do this after we created the actual
 196             protocol above so that proto hier stat still works though.
 197          */
 198[+]         if(!proto_field_is_referenced(tree, proto_frame)){
 199                  tree=NULL;
 200                  fh_tree = NULL;
 201          }
 202   
 203   
 204          if (fh_tree) {
 205            ts = pinfo->fd->abs_ts;
 206   
 207            proto_tree_add_time(fh_tree, hf_frame_arrival_time, tvb,
 208                  0, 0, &ts);
 209            if(ts.nsecs < 0 || ts.nsecs >= 1000000000) {
 210              item = proto_tree_add_none_format(fh_tree, hf_frame_time_invalid, tvb,
 211                    0, 0, "Arrival Time: Fractional second %09ld is invalid, the valid range is 0-1000000000", (long) ts.nsecs);
 212              PROTO_ITEM_SET_GENERATED(item);
 213              expert_add_info_format(pinfo, item, PI_MALFORMED, PI_WARN, "Arrival Time: Fractional second out of range (0-1000000000)");
 214            }
 215   
 216            ts = pinfo->fd->del_cap_ts;
 217   
 218            item = proto_tree_add_time(fh_tree, hf_frame_time_delta, tvb,
 219                  0, 0, &ts);
 220            PROTO_ITEM_SET_GENERATED(item);
 221   
 222            ts = pinfo->fd->del_dis_ts;
 223   
 224            item = proto_tree_add_time(fh_tree, hf_frame_time_delta_displayed, tvb,
 225                  0, 0, &ts);
 226            PROTO_ITEM_SET_GENERATED(item);
 227   
 228            ts = pinfo->fd->rel_ts;
 229   
 230            item = proto_tree_add_time(fh_tree, hf_frame_time_relative, tvb,
 231                  0, 0, &ts);
 232            PROTO_ITEM_SET_GENERATED(item);
 233   
 234            if(pinfo->fd->flags.ref_time){
 235[+]                 ti = proto_tree_add_item(fh_tree, hf_frame_time_reference, tvb, 0, 0, FALSE);
 236                  PROTO_ITEM_SET_GENERATED(ti);
Show more  




Change Warning 2376.32308 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: