Text  |   XML   |   Visible Warnings:

pvm3.4.6 : pvm3.4.6 analysis 2 : Null Pointer Dereference  at host.c:628

Categories: LANG.MEM.NPD CWE:476
Warning ID: 32.28615
Procedure: ht_delete
Trace: view
Modified: Thu Nov 26 11:27:05 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
   /kat0/fletcher/SATE/2010/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");   /* Integer Overflow of Allocation Size (ID: 34.28617) */
 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++ ) {
dsigs <= 4095628                                 if ( dsigs[i] == d )     /* Null Pointer Dereference */
 629                                         found++;
 630                         }
 631                         if ( !found ) {
 632                                 dsigs[ ndsigs++ ] = d;   /* Null Pointer Dereference (ID: 31.28614) */
 633                                 htp->ht_narch++;
Preconditions
&$unknown_3717 >= 1
htp->ht_last >= 2
hp->hd_dpath != 0
hp->hd_txq >= 0
hp->hd_opq >= 0
hp->hd_rxq >= 0
hp->hd_rxm >= 0
hp->hd_mcas >= 0
htp->ht_hosts[1]->hd_arch != 0
hp->hd_ref <= 1
Postconditions
d' = htp->ht_hosts[1]->hd_dsig
dsigs' = 0
errno' != 0
found' = 0
hh' = 1
hp' = htp->ht_hosts[1]
i' = 0
mask' = 0
ndsigs' = &$unknown_3717




Change Warning 32.28615 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: