Text  |   XML   |   Visible Warnings:

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

Categories: LANG.MEM.NPD CWE:476
Warning ID: 69.28655
Procedure: ht_insert
Trace: view
Modified: Thu Nov 26 11:27:16 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_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;
true528                 htp->ht_hosts = TREALLOC(htp->ht_hosts, htp->ht_last + 1, struct hostd*);   /* Integer Overflow of Allocation Size (ID: 70.28656) */
 529                 while (++n <= htp->ht_last)
htp->ht_hosts <= 4095530                         htp->ht_hosts[n] = 0;     /* Null Pointer Dereference */
Preconditions
htp->ht_hosts != 0
htp->ht_last <= -2
Postconditions
errno' != 0
hh' >= htp->ht_last + 1
mask' = 0
n' = htp->ht_last + 1




Change Warning 69.28655 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: