Text  |   XML   |   Visible Warnings:

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

Categories: LANG.MEM.NPD CWE:476
Warning ID: 2479.2507
Procedure: ht_insert
Trace: View
Modified: Wed Sep 2 12:39:47 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/pvmd.c
   Enter beprime
 4422 beprime() 
 4423 {
 4424         struct htab *htp;
 4425         struct task *tp;
 4426         int i;
 4427  
 4428         runstate = PVMDPRIME;
 4429  
 4430         if ((pvmmyupid = getpid()) == -1) {
 4431                 pvmlogerror("beprime() can't getpid()\n");
 4432                 pvmbailout(0);
 4433         }
 4434  
 4435         myhostpart = 0;
 4436         pvmmytid = TIDPVMD;
 4437  
true4438         htp = ht_new(hosts->ht_local);   /* Leak (ID: 2477.2505) */
 4439         htp->ht_master = hosts->ht_local;
 4440         htp->ht_local = 0;
 4441         ht_insert(htp, hosts->ht_hosts[hosts->ht_local]);
htp->ht_last < 5114442         ht_insert(htp, hosts->ht_hosts[0]);
     /u1/paul/SATE/2010/c/pvm/pvm3/src/host.c
     Enter beprime / ht_insert
((char*)$param_1)[4] < 511507   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) {
htp->ht_last < 511525                   int n = htp->ht_last;
 526    
 527                   htp->ht_last = (hh * 3) / 2;
n < 511528                   htp->ht_hosts = TREALLOC(htp->ht_hosts, htp->ht_last + 1, struct hostd*);
 529                   while (++n <= htp->ht_last)
htp->ht_hosts <= 4095530                           htp->ht_hosts[n] = 0;     /* Null Pointer Dereference */  /* 6 more... */
     Exit beprime / ht_insert
Preconditions
&$unknown_94256 >= 2
&$unknown_94257 >= 2
hosts->ht_local <= 0
((char*)&$heap_4013)[8] >= 0
Postconditions
$heap_4013' = 0
bytes_after(&$heap_4013)' = 40
$heap_4013' is allocated by malloc
$heap_4013' is allocated
bytes_before(&$heap_4013)' = 0
strlen(&$heap_4013)' = 0
((char*)&$heap_4013)[20]' = 0
((char*)&$heap_4013)[32]' = 0
((char*)&$heap_4013)[4]' = &$unknown_94257
((char*)&$heap_4013)[12]' = hosts->ht_local
$heap_4014' = 0
bytes_after(&$heap_4014)' = 16
$heap_4014' is allocated by malloc
$heap_4014' is allocated
bytes_before(&$heap_4014)' = 0
strlen(&$heap_4014)' = 0
hh' = &$unknown_94256
hp' = *hosts->ht_hosts
htp' = &$heap_4013
htp' = &$heap_4013
mask' = 0
myhostpart' = 0
n' = 2
pvmmyupid' != -1
runstate' = 4




Change Warning 2479.2507 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: