Text  |   XML   |   Visible Warnings:

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

Categories: LANG.MEM.NPD CWE:476
Warning ID: 2678.2727
Procedure: master_config
Trace: View
Modified: Wed Sep 2 12:43:14 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")))
 5392                         hp->hd_wdir = STRALLOC(s);   /* Null Pointer Dereference (ID: 2679.2728) */
 5393                 else 
true5394                         hp->hd_wdir = STRALLOC(pvmgethome());     /* Null Pointer Dereference */
Preconditions
$param_2 = 2
((char*)&$unknown_856065)[56] = 0
hd = 0
((char*)&$heap_121836)[8] >= -1
((char*)&$heap_121844)[144] >= 0
((char*)&$heap_121844)[32] = 0
Postconditions
((char*)&$unknown_856065)[40]' = &$heap_121850
((char*)&$unknown_856065)[48]' = &$heap_121852
argc' = $param_2
argv' = $param_3
atnewline' = 1
debugger' = 0
epaths' = &$heap_121851
filehosts' = &$unknown_856064
$heap_121836' = 1
bytes_after(&$heap_121836)' = 40
$heap_121836' is allocated by malloc
$heap_121836' is allocated
bytes_before(&$heap_121836)' = 0
strlen(&$heap_121836)' = 0
((char*)&$heap_121836)[16]' = 1
((char*)&$heap_121836)[20]' = 1
((char*)&$heap_121836)[8]' = ((char*)&$heap_121836)[8] + 1
((char*)&$heap_121836)[12]' = 1
$heap_121838' = 1
bytes_after(&$heap_121838)' = 200
$heap_121838' is allocated by malloc
bytes_before(&$heap_121838)' = 0
strlen(&$heap_121838)' = 0
((char*)&$heap_121838)[136]' = &$heap_121841
((char*)&$heap_121838)[152]' = 1
((char*)&$heap_121838)[16]' = &$heap_121843
((char*)&$heap_121838)[168]' = 1000
((char*)&$heap_121838)[176]' = 0
((char*)&$heap_121838)[76]' = pvmmydsig
((char*)&$heap_121838)[8]' = &$heap_121842
((char*)&$heap_121838)[84]' = pvmudpmtu
((char*)&$heap_121838)[88]' = 2
((char*)&$heap_121838)[104]' = 1
((char*)&$heap_121838)[108]' = 1
((char*)&$heap_121838)[112]' = &$heap_121839
((char*)&$heap_121838)[120]' = &$heap_121840
bytes_after(&$heap_121839)' = 184
$heap_121839' is allocated by malloc
$heap_121839' is allocated
bytes_before(&$heap_121839)' = 0
((char*)&$heap_121839)[16]' = 0
((char*)&$heap_121839)[176]' = 0
((char*)&$heap_121839)[24]' = 0
((char*)&$heap_121839)[32]' = 0
((char*)&$heap_121839)[40]' = 0
bytes_after(&$heap_121840)' = 184
$heap_121840' is allocated by malloc
$heap_121840' is allocated
bytes_before(&$heap_121840)' = 0
((char*)&$heap_121840)[16]' = 0
((char*)&$heap_121840)[176]' = 0
((char*)&$heap_121840)[24]' = 0
((char*)&$heap_121840)[32]' = 0
((char*)&$heap_121840)[40]' = 0
$heap_121841' = &$heap_121841
bytes_after(&$heap_121841)' = 184
$heap_121841' is allocated by malloc
$heap_121841' is allocated
bytes_before(&$heap_121841)' = 0
((char*)&$heap_121841)[16]' = 0
((char*)&$heap_121841)[176]' = 0
((char*)&$heap_121841)[24]' = 0
((char*)&$heap_121841)[32]' = 0
((char*)&$heap_121841)[40]' = 0
((char*)&$heap_121841)[8]' = &$heap_121841
$heap_121842' = *$param_1
bytes_after(&$heap_121842)' = strlen($param_1) + 1
$heap_121842' is allocated by malloc
$heap_121842' is allocated
bytes_before(&$heap_121842)' = 0
strlen(&$heap_121842)' = strlen($param_1)
$heap_121843' = *myarchname
bytes_after(&$heap_121843)' = strlen(myarchname) + 1
$heap_121843' is allocated by malloc
$heap_121843' is allocated
bytes_before(&$heap_121843)' = 0
strlen(&$heap_121843)' = strlen(myarchname)
$heap_121844' = 0
bytes_after(&$heap_121844)' = 200
$heap_121844' is allocated by malloc
$heap_121844' is freed
bytes_before(&$heap_121844)' = 0
strlen(&$heap_121844)' = 0
((char*)&$heap_121844)[136]' = &$heap_121847
((char*)&$heap_121844)[152]' = 1
((char*)&$heap_121844)[16]' = &$heap_121849
((char*)&$heap_121844)[168]' = 1000
((char*)&$heap_121844)[176]' = 0
((char*)&$heap_121844)[76]' = pvmmydsig
((char*)&$heap_121844)[8]' = &$heap_121848
((char*)&$heap_121844)[84]' = pvmudpmtu
((char*)&$heap_121844)[88]' = 2
((char*)&$heap_121844)[104]' = 1
((char*)&$heap_121844)[108]' = 1
((char*)&$heap_121844)[112]' = &$heap_121845
((char*)&$heap_121844)[120]' = &$heap_121846
bytes_after(&$heap_121845)' = 184
$heap_121845' is allocated by malloc
bytes_before(&$heap_121845)' = 0
((char*)&$heap_121845)[16]' = 0
((char*)&$heap_121845)[176]' = 0
((char*)&$heap_121845)[24]' = 0
((char*)&$heap_121845)[32]' = 0
((char*)&$heap_121845)[40]' = 0
bytes_after(&$heap_121846)' = 184
$heap_121846' is allocated by malloc
bytes_before(&$heap_121846)' = 0
((char*)&$heap_121846)[176]' = 0
((char*)&$heap_121846)[32]' = 0
((char*)&$heap_121846)[40]' = 0
$heap_121847' = &$heap_121847
bytes_after(&$heap_121847)' = 184
$heap_121847' is allocated by malloc
bytes_before(&$heap_121847)' = 0
((char*)&$heap_121847)[176]' = 0
((char*)&$heap_121847)[32]' = 0
((char*)&$heap_121847)[40]' = 0
((char*)&$heap_121847)[8]' = &$heap_121847
$heap_121848' = 112
bytes_after(&$heap_121848)' = 6
$heap_121848' is allocated by malloc
bytes_before(&$heap_121848)' = 0
strlen(&$heap_121848)' = 5
$heap_121849' = *myarchname
bytes_after(&$heap_121849)' = strlen(myarchname) + 1
$heap_121849' is allocated by malloc
bytes_before(&$heap_121849)' = 0
strlen(&$heap_121849)' = strlen(myarchname)
$heap_121850' = 36
bytes_after(&$heap_121850)' = 49
$heap_121850' is allocated by malloc
$heap_121850' is allocated
bytes_before(&$heap_121850)' = 0
bytes_after(&$heap_121851)' = 16
$heap_121851' is allocated by malloc
$heap_121851' is allocated
bytes_before(&$heap_121851)' = 0
$heap_121852' = 36
bytes_after(&$heap_121852)' = 23
$heap_121852' is allocated by malloc
$heap_121852' is allocated
bytes_before(&$heap_121852)' = 0
hn' = $param_1
hosts' = &$heap_121836
hp' = &$unknown_856065
hp2' = ((char*)$unknown_856064)[32]
s' = 0
tmbuf.tm_sec' = &$unknown_856067




Change Warning 2678.2727 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: