Text   |  XML   |  ReML   |   Visible Warnings:

Null Test After Dereference  at mate_runtime.c:355

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

reanalyze_gop

(/home/sate/Testcases/c/cve/wireshark-1.2.0/plugins/mate/mate_runtime.c)expand/collapse
Show more  
 308  static void reanalyze_gop(mate_gop* gop) {
 309          LoAL* gog_keys = NULL;
 310          AVPL* curr_gogkey = NULL;
 311          mate_cfg_gop* gop_cfg = NULL;
 312          void* cookie = NULL;
 313          AVPL* gogkey_match = NULL;
 314          mate_gog* gog = gop->gog;
 315          gogkey* gog_key;
 316           
 317          if ( ! gog ) return;
 318           
 319          gog->last_time = rd->now;
 320           
 321          dbg_print (dbg_gog,1,dbg_facility,"reanalize_gop: %s:%d",gop->cfg->name,gop->id);
 322           
 323          apply_extras(gop->avpl,gog->avpl,gog->cfg->extra);
 324           
 325          /* XXX: Instead of using the length of the avpl to check if an avpl has changed,
 326                          which is not accurate at all,  we should have apply_extras,
 327                          apply_transformations and other functions that can modify the avpl 
 328                      to flag the avpl if it has changed, then we'll check for the flag
 329                      and clear it after analysis */
 330           
 331          if (gog->last_n != gog->avpl->len) {
 332                   
 333                  dbg_print (dbg_gog,2,dbg_facility,"reanalize_gop: gog has new attributes let's look for new keys");
 334                   
 335                  gog_keys = gog->cfg->keys;
 336                   
 337                  while (( curr_gogkey = get_next_avpl(gog_keys,&cookie) )) {
 338                          gop_cfg = g_hash_table_lookup(mc->gopcfgs,curr_gogkey->name);
 339   
 340                          if (( gogkey_match = new_avpl_exact_match(gop_cfg->name,gog->avpl,curr_gogkey,FALSE) )) {                        
 341                                   
 342                                  gog_key = g_malloc(sizeof(gogkey));
 343                                   
 344                                  gog_key->key = avpl_to_str(gogkey_match);
 345                                  delete_avpl(gogkey_match,FALSE);
 346                                   
 347                                  gog_key->cfg = gop_cfg;
 348                                   
 349                                  if (g_hash_table_lookup(gop_cfg->gog_index,gog_key->key)) {
 350                                          g_free(gog_key->key);
 351                                          g_free(gog_key);
 352                                          gog_key = NULL;
 353                                  }  
 354                                   
 355                                  if (! gog_key ) {
 356                                          /* XXX: since these gogs actually share key info 
 357                                                          we should try to merge (non released) gogs 
 358                                                  that happen to have equal keys */
 359                                  } else {
 360                                          dbg_print (dbg_gog,1,dbg_facility,"analize_gop: new key for gog=%s:%d : %s",gog->cfg->name,gog->id,gog_key->key);
 361                                          g_ptr_array_add(gog->gog_keys,gog_key);
 362                                          g_hash_table_insert(gog_key->cfg->gog_index,gog_key->key,gog);
 363                                  }
 364                                   
 365                          }
 366                  }
 367                   
 368                  gog->last_n = gog->avpl->len;
 369          }
 370           
 371          if (gog->num_of_released_gops == gog->num_of_counting_gops) {
 372                  gog->released =  TRUE;
 373                  gog->expiration = gog->cfg->expiration + rd->now;
 374          } else {
 375                  gog->released =  FALSE;
 376          }
 377  }
Show more  




Change Warning 12280.30271 : Null Test After Dereference

Priority:
State:
Finding:
Owner:
Note: