Text  |   XML   |   Visible Warnings:

Pvm : Pvm analysis 1 : Null Pointer Dereference  at host.c:542

Categories: LANG.MEM.NPD CWE:476
Warning ID: 2474.2502
Procedure: ht_insert
Trace: View
Modified: Wed Sep 2 12:39:45 2009   show details
 
Priority: None
State: None
Finding: None
Owner: None
  edit properties

Legend [ X ]
Warning Location
Contributes
Parse Error
Other Warning
Two or More Loop Iterations
On Execution Path
Comment
Macro
Preprocessor
Include
Keyword
Preprocessed Away

Source  |  Language: C Hide Legend     
ProblemLineSource
   /u1/paul/SATE/2010/c/pvm/pvm3/src/host.c
   Enter ht_insert
 507 ht_insert(htp, hp) 
 508         struct htab *htp;
 509         struct hostd *hp;
 510 {
 511         int hh;
 512         int i;
 513         unsigned long mask = 0, tmpmask;
 514  
 515         int *dsigs;
 516         int ndsigs;
 517         int found;
 518         int d;
 519  
 520         hh = (hp->hd_hostpart & tidhmask) >> (ffs(tidhmask) - 1);
 521  
 522         /* extend ht_hosts[] if no room */ 
 523  
 524         if (hh > htp->ht_last) {
 525                 int n = htp->ht_last;
 526  
 527                 htp->ht_last = (hh * 3) / 2;
 528                 htp->ht_hosts = TREALLOC(htp->ht_hosts, htp->ht_last + 1, struct hostd*);
 529                 while (++n <= htp->ht_last)
 530                         htp->ht_hosts[n] = 0;   /* Null Pointer Dereference (ID: 2570.2602) */  /* 6 more... */
 531         }
 532  
 533         /* if already have an entry, take this as an update XXX kind of a hack */ 
 534  
 535         if (htp->ht_hosts[hh]) {        /* already have an entry */ 
 536  
 537                 struct hostd *hp2 = htp->ht_hosts[hh];
 538  
 539                 if (hp->hd_name) {
 540                         if (hp2->hd_name)
 541                                 PVM_FREE(hp2->hd_name);
true542                         hp2->hd_name = STRALLOC(hp->hd_name);     /* Null Pointer Dereference */
Preconditions
((char*)$param_1)[32] = 0
((char*)$param_2)[8] != 0
((char*)&$unknown_92962)[8] != 0
Postconditions
((char*)$unknown_92962)[8]' is freed
$heap_3644' is allocated by malloc
$heap_3644' is allocated
bytes_before(&$heap_3644)' = 0
hh' >= ((char*)$param_1)[4] + 1
hp' = $param_2
hp2' = &$unknown_92962
htp' = $param_1
mask' = 0




Change Warning 2474.2502 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: