Text  |   XML   |   Visible Warnings:

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

Categories: LANG.MEM.NPD CWE:476
Warning ID: 2680.2729
Procedure: master_config
Trace: View
Modified: Wed Sep 2 12:43: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
   /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)
true5388                 hp->hd_bpath = STRALLOC(DEFDEBUGGER);     /* Null Pointer Dereference */
Preconditions
$param_2 = 2
((char*)&((char*)$unknown_861709)[8])[48] = 0
strlen(((char*)&((char*)$unknown_861709)[8])[8]) > 0
((char*)&$unknown_861688)[4] >= 1
((char*)&$heap_128376)[8] >= 0
((char*)&$heap_128378)[144] >= 0
((char*)&$heap_128378)[32] = 0
((char*)&$heap_128385)[144] >= 0
((char*)&$heap_128385)[32] = 0
$input_12 >= 1
$input_60 != 0
Postconditions
((char*)&((char*)$unknown_861709)[8])[192]' = &$heap_128392
((char*)&((char*)$unknown_861709)[8])[40]' = &$heap_128394
argc' = $param_2
argv' = $param_3
epaths' = &$heap_128395
filehosts' = &$unknown_861688
$heap_128376' = 1
bytes_after(&$heap_128376)' = 40
$heap_128376' is allocated by malloc
$heap_128376' is allocated
bytes_before(&$heap_128376)' = 0
strlen(&$heap_128376)' = 0
((char*)&$heap_128376)[16]' = 1
((char*)&$heap_128376)[20]' = 1
((char*)&$heap_128376)[32]' = &$unknown_861709
((char*)&$heap_128376)[12]' = 1
$heap_128378' = 0
bytes_after(&$heap_128378)' = 200
$heap_128378' is allocated by malloc
$heap_128378' is freed
bytes_before(&$heap_128378)' = 0
strlen(&$heap_128378)' = 0
((char*)&$heap_128378)[136]' = &$heap_128380
((char*)&$heap_128378)[152]' = 1
((char*)&$heap_128378)[16]' = &$heap_128384
((char*)&$heap_128378)[168]' = 1000
((char*)&$heap_128378)[176]' = &$heap_128381
((char*)&$heap_128378)[76]' = pvmmydsig
((char*)&$heap_128378)[8]' = &$heap_128383
((char*)&$heap_128378)[84]' = pvmudpmtu
((char*)&$heap_128378)[88]' = 2
((char*)&$heap_128378)[104]' = 1
((char*)&$heap_128378)[108]' = 1
((char*)&$heap_128378)[112]' = &$heap_128379
((char*)&$heap_128378)[120]' = &$heap_128382
bytes_after(&$heap_128379)' = 184
$heap_128379' is allocated by malloc
bytes_before(&$heap_128379)' = 0
((char*)&$heap_128379)[16]' = 0
((char*)&$heap_128379)[176]' = 0
((char*)&$heap_128379)[24]' = 0
((char*)&$heap_128379)[32]' = 0
((char*)&$heap_128379)[40]' = 0
$heap_128380' = &$heap_128380
bytes_after(&$heap_128380)' = 184
$heap_128380' is allocated by malloc
bytes_before(&$heap_128380)' = 0
((char*)&$heap_128380)[176]' = 0
((char*)&$heap_128380)[32]' = 0
((char*)&$heap_128380)[40]' = 0
((char*)&$heap_128380)[8]' = &$heap_128380
bytes_after(&$heap_128381)' = 32
$heap_128381' is allocated by malloc
bytes_before(&$heap_128381)' = 0
((char*)&$heap_128381)[16]' = 0
((char*)&$heap_128381)[20]' = 0
((char*)&$heap_128381)[24]' = 0
bytes_after(&$heap_128382)' = 184
$heap_128382' is allocated by malloc
bytes_before(&$heap_128382)' = 0
((char*)&$heap_128382)[176]' = 0
((char*)&$heap_128382)[32]' = 0
((char*)&$heap_128382)[40]' = 0
$heap_128383' = *$param_1
bytes_after(&$heap_128383)' = strlen($param_1) + 1
$heap_128383' is allocated by malloc
bytes_before(&$heap_128383)' = 0
strlen(&$heap_128383)' = strlen($param_1)
$heap_128384' = *myarchname
bytes_after(&$heap_128384)' = strlen(myarchname) + 1
$heap_128384' is allocated by malloc
bytes_before(&$heap_128384)' = 0
strlen(&$heap_128384)' = strlen(myarchname)
$heap_128385' = 0
bytes_after(&$heap_128385)' = 200
$heap_128385' is allocated by malloc
$heap_128385' is freed
bytes_before(&$heap_128385)' = 0
strlen(&$heap_128385)' = 0
((char*)&$heap_128385)[136]' = &$heap_128389
((char*)&$heap_128385)[152]' = 1
((char*)&$heap_128385)[16]' = &$heap_128391
((char*)&$heap_128385)[168]' = 1000
((char*)&$heap_128385)[176]' = &$heap_128388
((char*)&$heap_128385)[76]' = pvmmydsig
((char*)&$heap_128385)[8]' = &$heap_128390
((char*)&$heap_128385)[84]' = pvmudpmtu
((char*)&$heap_128385)[88]' = 2
((char*)&$heap_128385)[104]' = 1
((char*)&$heap_128385)[108]' = 1
((char*)&$heap_128385)[112]' = &$heap_128387
((char*)&$heap_128385)[120]' = &$heap_128386
bytes_after(&$heap_128386)' = 184
$heap_128386' is allocated by malloc
bytes_before(&$heap_128386)' = 0
((char*)&$heap_128386)[176]' = 0
((char*)&$heap_128386)[32]' = 0
((char*)&$heap_128386)[40]' = 0
bytes_after(&$heap_128387)' = 184
$heap_128387' is allocated by malloc
bytes_before(&$heap_128387)' = 0
((char*)&$heap_128387)[16]' = 0
((char*)&$heap_128387)[176]' = 0
((char*)&$heap_128387)[24]' = 0
((char*)&$heap_128387)[32]' = 0
((char*)&$heap_128387)[40]' = 0
bytes_after(&$heap_128388)' = 32
$heap_128388' is allocated by malloc
bytes_before(&$heap_128388)' = 0
((char*)&$heap_128388)[16]' = 0
((char*)&$heap_128388)[20]' = 0
((char*)&$heap_128388)[24]' = 0
$heap_128389' = &$heap_128389
bytes_after(&$heap_128389)' = 184
$heap_128389' is allocated by malloc
bytes_before(&$heap_128389)' = 0
((char*)&$heap_128389)[176]' = 0
((char*)&$heap_128389)[32]' = 0
((char*)&$heap_128389)[40]' = 0
((char*)&$heap_128389)[8]' = &$heap_128389
$heap_128390' = 112
bytes_after(&$heap_128390)' = 6
$heap_128390' is allocated by malloc
bytes_before(&$heap_128390)' = 0
strlen(&$heap_128390)' = 5
$heap_128391' = *myarchname
bytes_after(&$heap_128391)' = strlen(myarchname) + 1
$heap_128391' is allocated by malloc
bytes_before(&$heap_128391)' = 0
strlen(&$heap_128391)' = strlen(myarchname)
bytes_after(&$heap_128392)' = strlen(((char*)&$unknown_861710)[192]) + 1
$heap_128392' is allocated by malloc
$heap_128392' is allocated
bytes_before(&$heap_128392)' = 0
strlen(&$heap_128392)' = strlen(((char*)&$unknown_861710)[192])
$heap_128393' = $input_60
bytes_after(&$heap_128393)' = $input_12 + 1
$heap_128393' is allocated by malloc
$heap_128393' is a non-heap object
bytes_before(&$heap_128393)' = 0
strlen(&$heap_128393)' = $input_12
$heap_128394' = $input_60
bytes_after(&$heap_128394)' = $input_12 + 1
$heap_128394' is allocated by malloc
$heap_128394' is allocated
bytes_before(&$heap_128394)' = 0
$heap_128395' = &$unknown_861711
bytes_after(&$heap_128395)' = 16
$heap_128395' is allocated by malloc
$heap_128395' is allocated
bytes_before(&$heap_128395)' = 0
((char*)&$heap_128395)[8]' = 0
hn' = $param_1
hosts' = &$heap_128376
hp' = ((char*)&$unknown_861709)[8]
hp2' = &$unknown_861710
s' = &$heap_128393




Change Warning 2680.2729 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: