Text   |  XML   |  ReML   |   Visible Warnings:

Null Test After Dereference  at tap-protohierstat.c:114

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

protohierstat_packet

(/home/sate/Testcases/c/cve/wireshark-1.2.0/tap-protohierstat.c)expand/collapse
Show more  
 75  protohierstat_packet(void *prs, packet_info *pinfo, epan_dissect_t *edt, const void *dummy _U_)
 76  {
 77          phs_t *rs=prs;
 78          phs_t *tmprs;
 79          proto_tree *tree;
 80          field_info *fi;
 81   
 82          if(!edt){
 83                  return 0;
 84          }
 85          if(!edt->tree){
 86                  return 0;
 87          }
 88          if(!edt->tree->first_child){
 89                  return 0;
 90          }
 91   
 92          for(tree=edt->tree->first_child;tree;tree=tree->next){
 93                  fi=PITEM_FINFO(tree);
 94   
 95                  /* first time we saw a protocol at this leaf */
 96                  if(rs->protocol==-1){
 97                          rs->protocol=fi->hfinfo->id;
 98                          rs->proto_name=fi->hfinfo->abbrev;
 99                          rs->frames=1;
 100                          rs->bytes=pinfo->fd->pkt_len;
 101                          rs->child=new_phs_t(rs);
 102                          rs=rs->child;
 103                          continue;
 104                  }
 105   
 106                  /* find this protocol in the list of siblings */
 107                  for(tmprs=rs;tmprs;tmprs=tmprs->sibling){
 108                          if(tmprs->protocol==fi->hfinfo->id){
 109                                  break;
 110                          }
 111                  }
 112   
 113                  /* not found, then we must add it to the end of the list */
 114                  if(!tmprs){
 115                          for(tmprs=rs;tmprs->sibling;tmprs=tmprs->sibling)
 116                                  ;
 117                          tmprs->sibling=new_phs_t(rs->parent);
 118                          rs=tmprs->sibling;
 119                          rs->protocol=fi->hfinfo->id;
 120                          rs->proto_name=fi->hfinfo->abbrev;
 121                  } else {
 122                          rs=tmprs;
 123                  }
 124   
 125                  rs->frames++;
 126                  rs->bytes+=pinfo->fd->pkt_len;
 127   
 128                  if(!rs->child){
 129                          rs->child=new_phs_t(rs);
 130                  }
 131                  rs=rs->child;
 132          }
 133          return 1;
 134  }
Show more  




Change Warning 12261.29719 : Null Test After Dereference

Priority:
State:
Finding:
Owner:
Note: