Text  |   XML   |   Visible Warnings:

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

Categories: LANG.MEM.NPD CWE:476
Warning ID: 2439.2467
Procedure: ht_delete
Trace: View
Modified: Wed Sep 2 12:39:32 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_delete
 593 ht_delete(htp, hp) 
 594         struct htab *htp;
 595         struct hostd *hp;
 596 {
 597         int hh;
 598         int i;
 599         unsigned long mask = 0, tmpmask;
 600  
 601         int *dsigs;
 602         int ndsigs;
 603         int found;
 604         int d;
 605  
 606         hh = (hp->hd_hostpart & tidhmask) >> (ffs(tidhmask) - 1);
 607         if (hh < 0 || hh > htp->ht_last || htp->ht_hosts[hh] != hp) {
 608                 pvmlogerror("ht_delete() host not in table\n");
 609                 return;
 610         }
 611         htp->ht_hosts[hh] = 0;
 612         if (hh)
 613                 htp->ht_cnt--;
 614  
 615         hd_unref(hp);
 616  
 617         /* update number of arches */ 
 618  
true619         dsigs = TALLOC( htp->ht_cnt, int, "dsigs");
 620         ndsigs = 0;
 621  
 622         htp->ht_narch = 0;
 623         for (hh = htp->ht_last; hh > 0; hh--) {
 624                 hp = htp->ht_hosts[hh];
 625                 if (hp && hp->hd_arch) {
 626                         d = htp->ht_hosts[hh]->hd_dsig;
 627                         for ( i=0, found=0 ; i < ndsigs && !found ; i++ ) {
 628                                 if ( dsigs[i] == d )   /* Null Pointer Dereference (ID: 2440.2468) */
 629                                         found++;
 630                         }
 631                         if ( !found ) {
dsigs <= 4095632                                 dsigs[ ndsigs++ ] = d;     /* Null Pointer Dereference */
Preconditions
((char*)$param_1)[4] >= 1
((char*)$param_1)[8] >= 0
((char*)$param_2)[136] >= 0
((char*)$param_2)[144] >= 0
((char*)$param_2)[176] >= 0
((char*)$param_2)[112] >= 0
((char*)$param_2)[120] >= 0
*$param_2 <= 1
((char*)&$unknown_6186)[16] != 0
Postconditions
dsigs' = 0
found' = 0
hh' = ((char*)$param_1)[4]
hp' = &$unknown_6186
htp' = $param_1
i' = 0
mask' = 0
ndsigs' = 1




Change Warning 2439.2467 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: