Text  |   XML   |   Visible Warnings:

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

Categories: LANG.MEM.NPD CWE:476
Warning ID: 2683.2732
Procedure: master_config
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  
 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")))
true5382                         hp->hd_epath = STRALLOC(s);     /* Null Pointer Dereference */
Preconditions
$param_2 = 2
&$unknown_870907 = 0
((char*)&$unknown_870906)[40] = 0
((char*)&$heap_136686)[8] >= 0
((char*)&$heap_136694)[144] >= 0
((char*)&$heap_136694)[32] != 0
$input_12 >= 0
Postconditions
((char*)$heap_136694)[32]' is freed
((char*)&$unknown_870906)[24]' = &$heap_136701
argc' = $param_2
argv' = $param_3
filehosts' = &$unknown_870905
$heap_136686' = 1
bytes_after(&$heap_136686)' = 40
$heap_136686' is allocated by malloc
$heap_136686' is allocated
bytes_before(&$heap_136686)' = 0
strlen(&$heap_136686)' = 0
((char*)&$heap_136686)[16]' = 1
((char*)&$heap_136686)[20]' = 1
((char*)&$heap_136686)[12]' = 1
$heap_136688' = 1
bytes_after(&$heap_136688)' = 200
$heap_136688' is allocated by malloc
bytes_before(&$heap_136688)' = 0
strlen(&$heap_136688)' = 0
((char*)&$heap_136688)[136]' = &$heap_136691
((char*)&$heap_136688)[152]' = 1
((char*)&$heap_136688)[16]' = &$heap_136693
((char*)&$heap_136688)[168]' = 1000
((char*)&$heap_136688)[176]' = 0
((char*)&$heap_136688)[76]' = pvmmydsig
((char*)&$heap_136688)[8]' = &$heap_136692
((char*)&$heap_136688)[84]' = pvmudpmtu
((char*)&$heap_136688)[88]' = 2
((char*)&$heap_136688)[104]' = 1
((char*)&$heap_136688)[108]' = 1
((char*)&$heap_136688)[112]' = &$heap_136689
((char*)&$heap_136688)[120]' = &$heap_136690
bytes_after(&$heap_136689)' = 184
$heap_136689' is allocated by malloc
$heap_136689' is allocated
bytes_before(&$heap_136689)' = 0
((char*)&$heap_136689)[16]' = 0
((char*)&$heap_136689)[176]' = 0
((char*)&$heap_136689)[24]' = 0
((char*)&$heap_136689)[32]' = 0
((char*)&$heap_136689)[40]' = 0
bytes_after(&$heap_136690)' = 184
$heap_136690' is allocated by malloc
$heap_136690' is allocated
bytes_before(&$heap_136690)' = 0
((char*)&$heap_136690)[16]' = 0
((char*)&$heap_136690)[176]' = 0
((char*)&$heap_136690)[24]' = 0
((char*)&$heap_136690)[32]' = 0
((char*)&$heap_136690)[40]' = 0
$heap_136691' = &$heap_136691
bytes_after(&$heap_136691)' = 184
$heap_136691' is allocated by malloc
$heap_136691' is allocated
bytes_before(&$heap_136691)' = 0
((char*)&$heap_136691)[16]' = 0
((char*)&$heap_136691)[176]' = 0
((char*)&$heap_136691)[24]' = 0
((char*)&$heap_136691)[32]' = 0
((char*)&$heap_136691)[40]' = 0
((char*)&$heap_136691)[8]' = &$heap_136691
$heap_136692' = *$param_1
bytes_after(&$heap_136692)' = strlen($param_1) + 1
$heap_136692' is allocated by malloc
$heap_136692' is allocated
bytes_before(&$heap_136692)' = 0
strlen(&$heap_136692)' = strlen($param_1)
$heap_136693' = *myarchname
bytes_after(&$heap_136693)' = strlen(myarchname) + 1
$heap_136693' is allocated by malloc
$heap_136693' is allocated
bytes_before(&$heap_136693)' = 0
strlen(&$heap_136693)' = strlen(myarchname)
$heap_136694' = 0
bytes_after(&$heap_136694)' = 200
$heap_136694' is allocated by malloc
$heap_136694' is freed
bytes_before(&$heap_136694)' = 0
strlen(&$heap_136694)' = 0
((char*)&$heap_136694)[136]' = &$heap_136698
((char*)&$heap_136694)[152]' = 1
((char*)&$heap_136694)[16]' = &$heap_136700
((char*)&$heap_136694)[168]' = 1000
((char*)&$heap_136694)[176]' = &$heap_136697
((char*)&$heap_136694)[76]' = pvmmydsig
((char*)&$heap_136694)[8]' = &$heap_136699
((char*)&$heap_136694)[84]' = pvmudpmtu
((char*)&$heap_136694)[88]' = 2
((char*)&$heap_136694)[104]' = 1
((char*)&$heap_136694)[108]' = 1
((char*)&$heap_136694)[112]' = &$heap_136696
((char*)&$heap_136694)[120]' = &$heap_136695
bytes_after(&$heap_136695)' = 184
$heap_136695' is allocated by malloc
bytes_before(&$heap_136695)' = 0
((char*)&$heap_136695)[176]' = 0
((char*)&$heap_136695)[32]' = 0
((char*)&$heap_136695)[40]' = 0
bytes_after(&$heap_136696)' = 184
$heap_136696' is allocated by malloc
bytes_before(&$heap_136696)' = 0
((char*)&$heap_136696)[16]' = 0
((char*)&$heap_136696)[176]' = 0
((char*)&$heap_136696)[24]' = 0
((char*)&$heap_136696)[32]' = 0
((char*)&$heap_136696)[40]' = 0
bytes_after(&$heap_136697)' = 32
$heap_136697' is allocated by malloc
bytes_before(&$heap_136697)' = 0
((char*)&$heap_136697)[16]' = 0
((char*)&$heap_136697)[20]' = 0
((char*)&$heap_136697)[24]' = 0
bytes_after(&$heap_136698)' = 184
$heap_136698' is allocated by malloc
bytes_before(&$heap_136698)' = 0
((char*)&$heap_136698)[176]' = 0
((char*)&$heap_136698)[32]' = 0
((char*)&$heap_136698)[40]' = 0
$heap_136699' = 112
bytes_after(&$heap_136699)' = 6
$heap_136699' is allocated by malloc
bytes_before(&$heap_136699)' = 0
strlen(&$heap_136699)' = 5
$heap_136700' = *myarchname
bytes_after(&$heap_136700)' = strlen(myarchname) + 1
$heap_136700' is allocated by malloc
bytes_before(&$heap_136700)' = 0
strlen(&$heap_136700)' = strlen(myarchname)
bytes_after(&$heap_136701)' = strlen(((char*)((char*)$unknown_870905)[32])[24]) + 1
$heap_136701' is allocated by malloc
$heap_136701' is allocated
bytes_before(&$heap_136701)' = 0
strlen(&$heap_136701)' = strlen(((char*)((char*)$unknown_870905)[32])[24])
$heap_136702' = $input_60
bytes_after(&$heap_136702)' = $input_12 + 1
$heap_136702' is allocated by malloc
$heap_136702' is a non-heap object
bytes_before(&$heap_136702)' = 0
strlen(&$heap_136702)' = $input_12
hn' = $param_1
hosts' = &$heap_136686
hp' = &$unknown_870906
hp2' = ((char*)$unknown_870905)[32]
s' = &$heap_136702




Change Warning 2683.2732 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: