Text  |   XML   |   Visible Warnings:

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

Categories: LANG.MEM.NPD CWE:476
Warning ID: 2679.2728
Procedure: master_config
Trace: View
Modified: Wed Sep 2 12:43:15 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 
 5384                         hp->hd_epath = STRALLOC(DEFBINDIR);   /* Null Pointer Dereference (ID: 2682.2731) */
 5385         }
 5386         epaths = colonsep(varsub(hp->hd_epath));
 5387         if (!hp->hd_bpath)
 5388                 hp->hd_bpath = STRALLOC(DEFDEBUGGER);   /* Null Pointer Dereference (ID: 2680.2729) */
 5389         debugger = varsub(hp->hd_bpath);
 5390         if (!hp->hd_wdir) {
 5391                 if ((s = getenv("PVM_WD")))
true5392                         hp->hd_wdir = STRALLOC(s);     /* Null Pointer Dereference */
Preconditions
$param_2 = 2
&$unknown_858057 = 0
((char*)&$unknown_858055)[56] = 0
((char*)&$heap_124506)[8] >= -1
((char*)&$heap_124514)[144] >= 0
((char*)&$heap_124514)[32] = 0
$input_12 >= 0
Postconditions
((char*)&$unknown_858055)[40]' = &$heap_124520
((char*)&$unknown_858055)[48]' = &$heap_124522
argc' = $param_2
argv' = $param_3
debugger' = &$heap_124523
epaths' = &$heap_124521
filehosts' = &$unknown_858054
$heap_124506' = 1
bytes_after(&$heap_124506)' = 40
$heap_124506' is allocated by malloc
$heap_124506' is allocated
bytes_before(&$heap_124506)' = 0
strlen(&$heap_124506)' = 0
((char*)&$heap_124506)[16]' = 1
((char*)&$heap_124506)[20]' = 1
((char*)&$heap_124506)[8]' = ((char*)&$heap_124506)[8] + 1
((char*)&$heap_124506)[12]' = 1
$heap_124508' = 1
bytes_after(&$heap_124508)' = 200
$heap_124508' is allocated by malloc
bytes_before(&$heap_124508)' = 0
strlen(&$heap_124508)' = 0
((char*)&$heap_124508)[136]' = &$heap_124511
((char*)&$heap_124508)[152]' = 1
((char*)&$heap_124508)[16]' = &$heap_124513
((char*)&$heap_124508)[168]' = 1000
((char*)&$heap_124508)[176]' = 0
((char*)&$heap_124508)[76]' = pvmmydsig
((char*)&$heap_124508)[8]' = &$heap_124512
((char*)&$heap_124508)[84]' = pvmudpmtu
((char*)&$heap_124508)[88]' = 2
((char*)&$heap_124508)[104]' = 1
((char*)&$heap_124508)[108]' = 1
((char*)&$heap_124508)[112]' = &$heap_124509
((char*)&$heap_124508)[120]' = &$heap_124510
bytes_after(&$heap_124509)' = 184
$heap_124509' is allocated by malloc
$heap_124509' is allocated
bytes_before(&$heap_124509)' = 0
((char*)&$heap_124509)[16]' = 0
((char*)&$heap_124509)[176]' = 0
((char*)&$heap_124509)[24]' = 0
((char*)&$heap_124509)[32]' = 0
((char*)&$heap_124509)[40]' = 0
bytes_after(&$heap_124510)' = 184
$heap_124510' is allocated by malloc
$heap_124510' is allocated
bytes_before(&$heap_124510)' = 0
((char*)&$heap_124510)[16]' = 0
((char*)&$heap_124510)[176]' = 0
((char*)&$heap_124510)[24]' = 0
((char*)&$heap_124510)[32]' = 0
((char*)&$heap_124510)[40]' = 0
$heap_124511' = &$heap_124511
bytes_after(&$heap_124511)' = 184
$heap_124511' is allocated by malloc
$heap_124511' is allocated
bytes_before(&$heap_124511)' = 0
((char*)&$heap_124511)[16]' = 0
((char*)&$heap_124511)[176]' = 0
((char*)&$heap_124511)[24]' = 0
((char*)&$heap_124511)[32]' = 0
((char*)&$heap_124511)[40]' = 0
((char*)&$heap_124511)[8]' = &$heap_124511
$heap_124512' = *$param_1
bytes_after(&$heap_124512)' = strlen($param_1) + 1
$heap_124512' is allocated by malloc
$heap_124512' is allocated
bytes_before(&$heap_124512)' = 0
strlen(&$heap_124512)' = strlen($param_1)
$heap_124513' = *myarchname
bytes_after(&$heap_124513)' = strlen(myarchname) + 1
$heap_124513' is allocated by malloc
$heap_124513' is allocated
bytes_before(&$heap_124513)' = 0
strlen(&$heap_124513)' = strlen(myarchname)
$heap_124514' = 0
bytes_after(&$heap_124514)' = 200
$heap_124514' is allocated by malloc
$heap_124514' is freed
bytes_before(&$heap_124514)' = 0
strlen(&$heap_124514)' = 0
((char*)&$heap_124514)[136]' = &$heap_124517
((char*)&$heap_124514)[152]' = 1
((char*)&$heap_124514)[16]' = &$heap_124519
((char*)&$heap_124514)[168]' = 1000
((char*)&$heap_124514)[176]' = 0
((char*)&$heap_124514)[76]' = pvmmydsig
((char*)&$heap_124514)[8]' = &$heap_124518
((char*)&$heap_124514)[84]' = pvmudpmtu
((char*)&$heap_124514)[88]' = 2
((char*)&$heap_124514)[104]' = 1
((char*)&$heap_124514)[108]' = 1
((char*)&$heap_124514)[112]' = &$heap_124515
((char*)&$heap_124514)[120]' = &$heap_124516
bytes_after(&$heap_124515)' = 184
$heap_124515' is allocated by malloc
bytes_before(&$heap_124515)' = 0
((char*)&$heap_124515)[16]' = 0
((char*)&$heap_124515)[176]' = 0
((char*)&$heap_124515)[24]' = 0
((char*)&$heap_124515)[32]' = 0
((char*)&$heap_124515)[40]' = 0
bytes_after(&$heap_124516)' = 184
$heap_124516' is allocated by malloc
bytes_before(&$heap_124516)' = 0
((char*)&$heap_124516)[176]' = 0
((char*)&$heap_124516)[32]' = 0
((char*)&$heap_124516)[40]' = 0
$heap_124517' = &$heap_124517
bytes_after(&$heap_124517)' = 184
$heap_124517' is allocated by malloc
bytes_before(&$heap_124517)' = 0
((char*)&$heap_124517)[176]' = 0
((char*)&$heap_124517)[32]' = 0
((char*)&$heap_124517)[40]' = 0
((char*)&$heap_124517)[8]' = &$heap_124517
$heap_124518' = 112
bytes_after(&$heap_124518)' = 6
$heap_124518' is allocated by malloc
bytes_before(&$heap_124518)' = 0
strlen(&$heap_124518)' = 5
$heap_124519' = *myarchname
bytes_after(&$heap_124519)' = strlen(myarchname) + 1
$heap_124519' is allocated by malloc
bytes_before(&$heap_124519)' = 0
strlen(&$heap_124519)' = strlen(myarchname)
$heap_124520' = 36
bytes_after(&$heap_124520)' = 49
$heap_124520' is allocated by malloc
$heap_124520' is allocated
bytes_before(&$heap_124520)' = 0
bytes_after(&$heap_124521)' = 16
$heap_124521' is allocated by malloc
$heap_124521' is allocated
bytes_before(&$heap_124521)' = 0
$heap_124522' = 36
bytes_after(&$heap_124522)' = 23
$heap_124522' is allocated by malloc
$heap_124522' is allocated
bytes_before(&$heap_124522)' = 0
strlen(&$heap_124522)' = 22
$heap_124523' is allocated by malloc
bytes_before(&$heap_124523)' = 0
$heap_124524' = $input_60
bytes_after(&$heap_124524)' = $input_12 + 1
$heap_124524' is allocated by malloc
$heap_124524' is a non-heap object
bytes_before(&$heap_124524)' = 0
strlen(&$heap_124524)' = $input_12
hn' = $param_1
hosts' = &$heap_124506
hp' = &$unknown_858055
hp2' = ((char*)$unknown_858054)[32]
s' = &$heap_124524




Change Warning 2679.2728 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: