Text  |   XML   |   Visible Warnings:

Pvm : Pvm analysis 1 : Null Pointer Dereference  at pvmd.c:5384

Categories: LANG.MEM.NPD CWE:476
Warning ID: 2682.2731
Procedure: master_config
Trace: View
Modified: Wed Sep 2 12:43:19 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  
 5347         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;
 5366         ht_insert(hosts, hp);
 5367         hd_unref(hp);
 5368  
 5369         /*
 5370         * get attributes from host file if available 
 5371         */ 
 5372  
 5373         hp = hosts->ht_hosts[1];
 5374         if (filehosts &&
 5375                         ((hp2 = nametohost(filehosts, hp->hd_name)) 
 5376                         || (hp2 = filehosts->ht_hosts[0]))) {
 5377                 applydefaults(hp, hp2);
 5378         }
 5379  
 5380         if (!hp->hd_epath) {
 5381                 if ((s = getenv("PVM_PATH")))
 5382                         hp->hd_epath = STRALLOC(s);   /* Null Pointer Dereference (ID: 2683.2732) */
 5383                 else 
true5384                         hp->hd_epath = STRALLOC(DEFBINDIR);     /* Null Pointer Dereference */
Preconditions
$param_2 = 2
((char*)&((char*)$unknown_869794)[8])[40] = 0
((char*)&$heap_134604)[8] >= 0
((char*)&$heap_134606)[144] >= 0
((char*)&$heap_134606)[32] = 0
((char*)&$heap_134613)[144] >= 0
((char*)&$heap_134613)[32] = 0
Postconditions
((char*)&((char*)$unknown_869794)[8])[24]' = &$heap_134620
argc' = $param_2
argv' = $param_3
filehosts' = &$unknown_869773
$heap_134604' = 1
bytes_after(&$heap_134604)' = 40
$heap_134604' is allocated by malloc
$heap_134604' is allocated
bytes_before(&$heap_134604)' = 0
strlen(&$heap_134604)' = 0
((char*)&$heap_134604)[16]' = 1
((char*)&$heap_134604)[20]' = 1
((char*)&$heap_134604)[32]' = &$unknown_869794
((char*)&$heap_134604)[12]' = 1
$heap_134606' = 0
bytes_after(&$heap_134606)' = 200
$heap_134606' is allocated by malloc
$heap_134606' is freed
bytes_before(&$heap_134606)' = 0
strlen(&$heap_134606)' = 0
((char*)&$heap_134606)[136]' = &$heap_134608
((char*)&$heap_134606)[152]' = 1
((char*)&$heap_134606)[16]' = &$heap_134612
((char*)&$heap_134606)[168]' = 1000
((char*)&$heap_134606)[176]' = &$heap_134609
((char*)&$heap_134606)[76]' = pvmmydsig
((char*)&$heap_134606)[8]' = &$heap_134611
((char*)&$heap_134606)[84]' = pvmudpmtu
((char*)&$heap_134606)[88]' = 2
((char*)&$heap_134606)[104]' = 1
((char*)&$heap_134606)[108]' = 1
((char*)&$heap_134606)[112]' = &$heap_134607
((char*)&$heap_134606)[120]' = &$heap_134610
bytes_after(&$heap_134607)' = 184
$heap_134607' is allocated by malloc
bytes_before(&$heap_134607)' = 0
((char*)&$heap_134607)[16]' = 0
((char*)&$heap_134607)[176]' = 0
((char*)&$heap_134607)[24]' = 0
((char*)&$heap_134607)[32]' = 0
((char*)&$heap_134607)[40]' = 0
bytes_after(&$heap_134608)' = 184
$heap_134608' is allocated by malloc
bytes_before(&$heap_134608)' = 0
((char*)&$heap_134608)[176]' = 0
((char*)&$heap_134608)[32]' = 0
((char*)&$heap_134608)[40]' = 0
bytes_after(&$heap_134609)' = 32
$heap_134609' is allocated by malloc
bytes_before(&$heap_134609)' = 0
((char*)&$heap_134609)[16]' = 0
((char*)&$heap_134609)[20]' = 0
((char*)&$heap_134609)[24]' = 0
bytes_after(&$heap_134610)' = 184
$heap_134610' is allocated by malloc
bytes_before(&$heap_134610)' = 0
((char*)&$heap_134610)[176]' = 0
((char*)&$heap_134610)[32]' = 0
((char*)&$heap_134610)[40]' = 0
$heap_134611' = *$param_1
bytes_after(&$heap_134611)' = strlen($param_1) + 1
$heap_134611' is allocated by malloc
bytes_before(&$heap_134611)' = 0
strlen(&$heap_134611)' = strlen($param_1)
$heap_134612' = *myarchname
bytes_after(&$heap_134612)' = strlen(myarchname) + 1
$heap_134612' is allocated by malloc
bytes_before(&$heap_134612)' = 0
strlen(&$heap_134612)' = strlen(myarchname)
$heap_134613' = 0
bytes_after(&$heap_134613)' = 200
$heap_134613' is allocated by malloc
$heap_134613' is freed
bytes_before(&$heap_134613)' = 0
strlen(&$heap_134613)' = 0
((char*)&$heap_134613)[136]' = &$heap_134617
((char*)&$heap_134613)[152]' = 1
((char*)&$heap_134613)[16]' = &$heap_134619
((char*)&$heap_134613)[168]' = 1000
((char*)&$heap_134613)[176]' = &$heap_134616
((char*)&$heap_134613)[76]' = pvmmydsig
((char*)&$heap_134613)[8]' = &$heap_134618
((char*)&$heap_134613)[84]' = pvmudpmtu
((char*)&$heap_134613)[88]' = 2
((char*)&$heap_134613)[104]' = 1
((char*)&$heap_134613)[108]' = 1
((char*)&$heap_134613)[112]' = &$heap_134615
((char*)&$heap_134613)[120]' = &$heap_134614
bytes_after(&$heap_134614)' = 184
$heap_134614' is allocated by malloc
bytes_before(&$heap_134614)' = 0
((char*)&$heap_134614)[176]' = 0
((char*)&$heap_134614)[32]' = 0
((char*)&$heap_134614)[40]' = 0
bytes_after(&$heap_134615)' = 184
$heap_134615' is allocated by malloc
bytes_before(&$heap_134615)' = 0
((char*)&$heap_134615)[16]' = 0
((char*)&$heap_134615)[176]' = 0
((char*)&$heap_134615)[24]' = 0
((char*)&$heap_134615)[32]' = 0
((char*)&$heap_134615)[40]' = 0
bytes_after(&$heap_134616)' = 32
$heap_134616' is allocated by malloc
bytes_before(&$heap_134616)' = 0
((char*)&$heap_134616)[16]' = 0
((char*)&$heap_134616)[20]' = 0
((char*)&$heap_134616)[24]' = 0
$heap_134617' = &$heap_134617
bytes_after(&$heap_134617)' = 184
$heap_134617' is allocated by malloc
bytes_before(&$heap_134617)' = 0
((char*)&$heap_134617)[176]' = 0
((char*)&$heap_134617)[32]' = 0
((char*)&$heap_134617)[40]' = 0
((char*)&$heap_134617)[8]' = &$heap_134617
$heap_134618' = 112
bytes_after(&$heap_134618)' = 6
$heap_134618' is allocated by malloc
bytes_before(&$heap_134618)' = 0
strlen(&$heap_134618)' = 5
$heap_134619' = *myarchname
bytes_after(&$heap_134619)' = strlen(myarchname) + 1
$heap_134619' is allocated by malloc
bytes_before(&$heap_134619)' = 0
strlen(&$heap_134619)' = strlen(myarchname)
bytes_after(&$heap_134620)' = strlen(((char*)((char*)$unknown_869773)[32])[24]) + 1
$heap_134620' is allocated by malloc
$heap_134620' is allocated
bytes_before(&$heap_134620)' = 0
strlen(&$heap_134620)' = strlen(((char*)((char*)$unknown_869773)[32])[24])
hn' = $param_1
hosts' = &$heap_134604
hp' = ((char*)&$unknown_869794)[8]
hp2' = ((char*)$unknown_869773)[32]
s' = 0




Change Warning 2682.2731 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: