Text   |  XML   |  ReML   |   Visible Warnings:

Null Pointer Dereference  at tap-dcerpcstat.c:257

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

dcerpcstat_init

(/home/sate/Testcases/c/cve/wireshark-1.2.0/tap-dcerpcstat.c)expand/collapse
Show more  
 180  dcerpcstat_init(const char *optarg, void* userdata _U_)
 181  {
 182          rpcstat_t *rs;
 183          guint32 i, max_procs;
 184          dcerpc_sub_dissector *procs;
 185          e_uuid_t uuid;
 186          guint d1,d2,d3,d40,d41,d42,d43,d44,d45,d46,d47;
 187          int major, minor;
 188          guint16 ver;
 189          int pos=0;
 190          const char *filter=NULL;
 191          GString *error_string;
 192       
 193          /*
 194           * XXX - DCE RPC statistics are maintained only by major version,
 195           * not by major and minor version, so the minor version number is
 196           * ignored.
 197           *
 198           * Should we just stop supporting minor version numbers here?
 199           * Or should we allow it to be omitted?  Or should we keep 
 200           * separate statistics for different minor version numbers,
 201           * and allow the minor version number to be omitted, and 
 202           * report aggregate statistics for all minor version numbers
 203           * if it's omitted?
 204           *
 205           * XXX - should this be called "srt" rather than "rtt"?  The
 206           * equivalent tap for Wireshark calls it "srt", for "Service
 207           * Response Time", rather than "rtt" for "Round-Trip Time".
 208           */
 209          if(sscanf(optarg,"dcerpc,rtt,%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x,%d.%d%n", &d1,&d2,&d3,&d40,&d41,&d42,&d43,&d44,&d45,&d46,&d47,&major,&minor,&pos)==13){
 210                  uuid.Data1=d1;
 211                  uuid.Data2=d2;
 212                  uuid.Data3=d3;
 213                  uuid.Data4[0]=d40;
 214                  uuid.Data4[1]=d41;
 215                  uuid.Data4[2]=d42;
 216                  uuid.Data4[3]=d43;
 217                  uuid.Data4[4]=d44;
 218                  uuid.Data4[5]=d45;
 219                  uuid.Data4[6]=d46;
 220                  uuid.Data4[7]=d47;
 221                  if(pos){
 222                          filter=optarg+pos;
 223                  } else {
 224                          filter=NULL;
 225                  }
 226          } else {
 227                  fprintf(stderr, "tshark: invalid \"-z dcerpc,rtt,<uuid>,<major version>.<minor version>[,<filter>]\" argument\n");
 228                  exit(1);
 229          }
 230          if (major < 0 || major > 65535) {
 231                  fprintf(stderr,"tshark: dcerpcstat_init() Major version number %d is invalid - must be positive and <= 65535\n", major);
 232                  exit(1);
 233          }
 234          if (minor < 0 || minor > 65535) {
 235                  fprintf(stderr,"tshark: dcerpcstat_init() Minor version number %d is invalid - must be positive and <= 65535\n", minor);
 236                  exit(1);
 237          }
 238          ver = major;
 239   
 240          rs=g_malloc(sizeof(rpcstat_t));
 241          rs->prog=dcerpc_get_proto_name(&uuid, ver);
 242          if(!rs->prog){
 243                  g_free(rs);
 244                  fprintf(stderr,"tshark: dcerpcstat_init() Protocol with uuid:%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x v%u not supported\n",uuid.Data1,uuid.Data2,uuid.Data3,uuid.Data4[0],uuid.Data4[1],uuid.Data4[2],uuid.Data4[3],uuid.Data4[4],uuid.Data4[5],uuid.Data4[6],uuid.Data4[7],ver);
 245                  exit(1);
 246          }
 247[+]         procs=dcerpc_get_proto_sub_dissector(&uuid, ver);
 248          rs->uuid=uuid;
 249          rs->ver=ver;
 250   
 251          if(filter){
 252                  rs->filter=g_strdup(filter);
 253          } else {
 254                  rs->filter=NULL;
 255          }
 256   
 257          for(i=0,max_procs=0;procs[i].name;i++){
Show more  




Change Warning 4860.30897 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: