Text  |   XML   |   Visible Warnings:

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

Categories: LANG.MEM.NPD CWE:476
Warning ID: 2684.2733
Procedure: ht_insert
Trace: View
Modified: Wed Sep 2 12:43:20 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 master_config
 5317 master_config(hn, argc, argv) 
 5318         char *hn;                       /* hostname or null */ 
 5319         int argc;
 5320         char **argv;
 5321 {
 5322         struct hostent *he;
 5323         struct hostd *hp;
 5324         struct hostd *hp2;
 5325         int i;
 5326         char *s;
 5327  
 5328         if (argc > 2) {
 5329                 pvmlogerror("usage: pvmd3 [-ddebugmask] [-nhostname] [hostfile]\n");
 5330                 pvmbailout(0);
 5331         }
 5332         if (argc == 2) {
 5333                 filehosts = readhostfile(argv[1]);
 5334         }
 5335         else if (s = getenv("PVMHOSTFILE")) {
 5336                 filehosts = readhostfile(s);
 5337         }
 5338         if (pvmdebmask & PDMSTARTUP) {
 5339                 if (filehosts) {
 5340                         pvmlogerror("master_config() host file:\n");
 5341                         ht_dump(filehosts);
 5342  
 5343                 } else 
 5344                         pvmlogerror("master_config() null host file\n");
 5345         }
 5346  
true5347         hosts = ht_new(1);
 5348         hosts->ht_serial = 1;
 5349         hosts->ht_master = 1;
 5350         hosts->ht_cons = 1;
 5351         hosts->ht_local = 1;
 5352  
 5353         hp = hd_new(1);
 5354         hp->hd_name = STRALLOC(hn);   /* Null Pointer Dereference (ID: 2687.2738) */
 5355         hp->hd_arch = STRALLOC(myarchname);   /* Null Pointer Dereference (ID: 2685.2737) */
 5356         hp->hd_mtu = pvmudpmtu;
 5357         hp->hd_dsig = pvmmydsig;
 5358         ht_insert(hosts, hp);
 5359         hd_unref(hp);
 5360  
 5361         hp = hd_new(0);
 5362         hp->hd_name = STRALLOC("pvmd'");   /* Null Pointer Dereference (ID: 2686.2736) */
 5363         hp->hd_arch = STRALLOC(myarchname);   /* Null Pointer Dereference (ID: 2685.2734) */
 5364         hp->hd_mtu = pvmudpmtu;
 5365         hp->hd_dsig = pvmmydsig;
hosts->ht_last < 5115366         ht_insert(hosts, hp);
     /u1/paul/SATE/2010/c/pvm/pvm3/src/host.c
     Enter master_config / 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 master_config / ht_insert
Preconditions
$param_2 <= 1
&$unknown_871560 >= 2
&$unknown_871561 >= 2
((char*)&$heap_140008)[8] >= 0
$input_12 >= 0
Postconditions
argc' = $param_2
argv' = $param_3
filehosts' = 0
bytes_after(&$heap_140007)' = $input_12 + 1
$heap_140007' is allocated by malloc
$heap_140007' is a non-heap object
bytes_before(&$heap_140007)' = 0
strlen(&$heap_140007)' = $input_12
$heap_140008' = 1
bytes_after(&$heap_140008)' = 40
$heap_140008' is allocated by malloc
$heap_140008' is allocated
bytes_before(&$heap_140008)' = 0
strlen(&$heap_140008)' = 0
((char*)&$heap_140008)[16]' = 1
((char*)&$heap_140008)[20]' = 1
((char*)&$heap_140008)[32]' = 0
((char*)&$heap_140008)[4]' = &$unknown_871561
((char*)&$heap_140008)[12]' = 1
$heap_140009' = 0
bytes_after(&$heap_140009)' = 16
$heap_140009' is allocated by malloc
$heap_140009' is allocated
bytes_before(&$heap_140009)' = 0
strlen(&$heap_140009)' = 0
$heap_140010' = 1
bytes_after(&$heap_140010)' = 200
$heap_140010' is allocated by malloc
bytes_before(&$heap_140010)' = 0
strlen(&$heap_140010)' = 0
((char*)&$heap_140010)[136]' = &$heap_140013
((char*)&$heap_140010)[152]' = 1
((char*)&$heap_140010)[16]' = &$heap_140015
((char*)&$heap_140010)[168]' = 1000
((char*)&$heap_140010)[176]' = 0
((char*)&$heap_140010)[76]' = pvmmydsig
((char*)&$heap_140010)[8]' = &$heap_140014
((char*)&$heap_140010)[84]' = pvmudpmtu
((char*)&$heap_140010)[88]' = 2
((char*)&$heap_140010)[104]' = 1
((char*)&$heap_140010)[108]' = 1
((char*)&$heap_140010)[112]' = &$heap_140011
((char*)&$heap_140010)[120]' = &$heap_140012
bytes_after(&$heap_140011)' = 184
$heap_140011' is allocated by malloc
$heap_140011' is allocated
bytes_before(&$heap_140011)' = 0
((char*)&$heap_140011)[16]' = 0
((char*)&$heap_140011)[176]' = 0
((char*)&$heap_140011)[24]' = 0
((char*)&$heap_140011)[32]' = 0
((char*)&$heap_140011)[40]' = 0
bytes_after(&$heap_140012)' = 184
$heap_140012' is allocated by malloc
$heap_140012' is allocated
bytes_before(&$heap_140012)' = 0
((char*)&$heap_140012)[16]' = 0
((char*)&$heap_140012)[176]' = 0
((char*)&$heap_140012)[24]' = 0
((char*)&$heap_140012)[32]' = 0
((char*)&$heap_140012)[40]' = 0
$heap_140013' = &$heap_140013
bytes_after(&$heap_140013)' = 184
$heap_140013' is allocated by malloc
$heap_140013' is allocated
bytes_before(&$heap_140013)' = 0
((char*)&$heap_140013)[16]' = 0
((char*)&$heap_140013)[176]' = 0
((char*)&$heap_140013)[24]' = 0
((char*)&$heap_140013)[32]' = 0
((char*)&$heap_140013)[40]' = 0
((char*)&$heap_140013)[8]' = &$heap_140013
$heap_140014' = *$param_1
bytes_after(&$heap_140014)' = strlen($param_1) + 1
$heap_140014' is allocated by malloc
$heap_140014' is allocated
bytes_before(&$heap_140014)' = 0
strlen(&$heap_140014)' = strlen($param_1)
$heap_140015' = *myarchname
bytes_after(&$heap_140015)' = strlen(myarchname) + 1
$heap_140015' is allocated by malloc
$heap_140015' is allocated
bytes_before(&$heap_140015)' = 0
strlen(&$heap_140015)' = strlen(myarchname)
$heap_140016' = 1
bytes_after(&$heap_140016)' = 200
$heap_140016' is allocated by malloc
$heap_140016' is allocated
bytes_before(&$heap_140016)' = 0
strlen(&$heap_140016)' = 0
((char*)&$heap_140016)[136]' = &$heap_140019
((char*)&$heap_140016)[152]' = 1
((char*)&$heap_140016)[16]' = &$heap_140021
((char*)&$heap_140016)[168]' = 1000
((char*)&$heap_140016)[176]' = 0
((char*)&$heap_140016)[76]' = pvmmydsig
((char*)&$heap_140016)[8]' = &$heap_140020
((char*)&$heap_140016)[84]' = pvmudpmtu
((char*)&$heap_140016)[88]' = 2
((char*)&$heap_140016)[104]' = 1
((char*)&$heap_140016)[108]' = 1
((char*)&$heap_140016)[112]' = &$heap_140017
((char*)&$heap_140016)[120]' = &$heap_140018
bytes_after(&$heap_140017)' = 184
$heap_140017' is allocated by malloc
$heap_140017' is allocated
bytes_before(&$heap_140017)' = 0
((char*)&$heap_140017)[16]' = 0
((char*)&$heap_140017)[176]' = 0
((char*)&$heap_140017)[24]' = 0
((char*)&$heap_140017)[32]' = 0
((char*)&$heap_140017)[40]' = 0
bytes_after(&$heap_140018)' = 184
$heap_140018' is allocated by malloc
$heap_140018' is allocated
bytes_before(&$heap_140018)' = 0
((char*)&$heap_140018)[16]' = 0
((char*)&$heap_140018)[176]' = 0
((char*)&$heap_140018)[24]' = 0
((char*)&$heap_140018)[32]' = 0
((char*)&$heap_140018)[40]' = 0
$heap_140019' = &$heap_140019
bytes_after(&$heap_140019)' = 184
$heap_140019' is allocated by malloc
$heap_140019' is allocated
bytes_before(&$heap_140019)' = 0
((char*)&$heap_140019)[16]' = 0
((char*)&$heap_140019)[176]' = 0
((char*)&$heap_140019)[24]' = 0
((char*)&$heap_140019)[32]' = 0
((char*)&$heap_140019)[40]' = 0
((char*)&$heap_140019)[8]' = &$heap_140019
$heap_140020' = 112
bytes_after(&$heap_140020)' = 6
$heap_140020' is allocated by malloc
$heap_140020' is allocated
bytes_before(&$heap_140020)' = 0
strlen(&$heap_140020)' = 5
$heap_140021' = *myarchname
bytes_after(&$heap_140021)' = strlen(myarchname) + 1
$heap_140021' is allocated by malloc
$heap_140021' is allocated
bytes_before(&$heap_140021)' = 0
strlen(&$heap_140021)' = strlen(myarchname)
hh' = &$unknown_871560
hn' = $param_1
hosts' = &$heap_140008
hp' = &$heap_140016
hp' = &$heap_140016
htp' = &$heap_140008
mask' = 0
n' = 2
s' = &$heap_140007




Change Warning 2684.2733 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: