Text  |   XML   |   Visible Warnings:

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

Categories: LANG.MEM.NPD CWE:476
Warning ID: 66.28652
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;
 528                 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)
 530                         htp->ht_hosts[n] = 0;   /* Null Pointer Dereference (ID: 69.28655) */
 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 */   /* Null Pointer Dereference (ID: 68.28654) */
 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);
 542                         hp2->hd_name = STRALLOC(hp->hd_name);   /* Null Pointer Dereference (ID: 67.28653) */
 543                 }
 544                 if (hp->hd_arch) {
 545                         if (hp2->hd_arch)
 546                                 PVM_FREE(hp2->hd_arch);
true547                         hp2->hd_arch = STRALLOC(hp->hd_arch);     /* Null Pointer Dereference */
Preconditions
htp->ht_hosts != 0
((char*)&$unknown_67237)[12] != 0
Postconditions
((char*)$unknown_67237)[8]' is freed
((char*)$unknown_67237)[12]' is freed
((char*)&$unknown_67237)[8]' = &$heap_3142
errno' != 0
$heap_3141' = *htp->ht_hosts
$heap_3141' is allocated by malloc
$heap_3141' is allocated
bytes_before(&$heap_3141)' = 0
$heap_3142' = *hp->hd_name
bytes_after(&$heap_3142)' = strlen(hp->hd_name) + 1
$heap_3142' is allocated by malloc
$heap_3142' is allocated
bytes_before(&$heap_3142)' = 0
strlen(&$heap_3142)' = strlen(hp->hd_name)
tocttou($heap_3142)' = tocttou(*hp->hd_name)
hh' >= htp->ht_last + 1
hp2' = &$unknown_67237
mask' = 0




Change Warning 66.28652 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: