Text  |   XML   |   Visible Warnings:

pvm3.4.6 : pvm3.4.6 analysis 2 : Null Pointer Dereference  at pvmd.c:5394

Categories: LANG.MEM.NPD CWE:476
Warning ID: 22081.28918
Procedure: master_config
Trace: view
Modified: Thu Nov 26 11:28:35 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
   /kat0/fletcher/SATE/2010/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: 265.28929) */
 5355         hp->hd_arch = STRALLOC(myarchname);   /* Null Pointer Dereference (ID: 263.28928) */
 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: 264.28927) */
 5363         hp->hd_arch = STRALLOC(myarchname);   /* Null Pointer Dereference (ID: 263.28925) */
 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: 22087.28924) */
 5383                 else 
 5384                         hp->hd_epath = STRALLOC(DEFBINDIR);   /* Null Pointer Dereference (ID: 22086.28923) */
 5385         }
 5386         epaths = colonsep(varsub(hp->hd_epath));
 5387         if (!hp->hd_bpath)
 5388                 hp->hd_bpath = STRALLOC(DEFDEBUGGER);   /* Null Pointer Dereference (ID: 22083.28920) */
 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: 22082.28919) */
 5393                 else 
true5394                         hp->hd_wdir = STRALLOC(pvmgethome());     /* Null Pointer Dereference */
Preconditions
argc = 2
((char*)&((char*)((char*)$heap_204562)[28])[4])[32] = 0
$unknown_760009 != 58
((char*)&$heap_204562)[4] <= 1
Postconditions
((char*)&((char*)((char*)$heap_204562)[28])[4])[24]' = &$heap_204577
((char*)&((char*)((char*)$heap_204562)[28])[4])[28]' = &$heap_204579
atnewline' = 1
debugger' = &$unknown_760010
epaths' = &$heap_204578
errno' != 0
filehosts' = 0
hd' = &#string17[0]
$heap_204562' = 1
bytes_after(&$heap_204562)' = 32
$heap_204562' is allocated by malloc
$heap_204562' is allocated
bytes_before(&$heap_204562)' = 0
((char*)&$heap_204562)[16]' = 1
((char*)&$heap_204562)[20]' = 1
((char*)&$heap_204562)[24]' = 0
((char*)&$heap_204562)[8]' = ((char*)&$heap_204562)[8] + 1
((char*)&$heap_204562)[12]' = 1
bytes_after(&$heap_204563)' = 120
$heap_204563' is allocated by malloc
$heap_204563' is allocated
bytes_before(&$heap_204563)' = 0
((char*)&$heap_204563)[16]' = 0
((char*)&$heap_204563)[20]' = 0
((char*)&$heap_204563)[8]' = 0
((char*)&$heap_204563)[116]' = 0
((char*)&$heap_204563)[12]' = 0
$heap_204564' = &$heap_204564
bytes_after(&$heap_204564)' = 120
$heap_204564' is allocated by malloc
$heap_204564' is allocated
bytes_before(&$heap_204564)' = 0
((char*)&$heap_204564)[16]' = 0
((char*)&$heap_204564)[20]' = 0
((char*)&$heap_204564)[4]' = &$heap_204564
((char*)&$heap_204564)[8]' = 0
((char*)&$heap_204564)[116]' = 0
((char*)&$heap_204564)[12]' = 0
bytes_after(&$heap_204565)' = 20
$heap_204565' is allocated by malloc
$heap_204565' is allocated
bytes_before(&$heap_204565)' = 0
((char*)&$heap_204565)[16]' = 0
((char*)&$heap_204565)[8]' = 0
((char*)&$heap_204565)[12]' = 0
$heap_204566' = &$heap_204566
bytes_after(&$heap_204566)' = 120
$heap_204566' is allocated by malloc
$heap_204566' is allocated
bytes_before(&$heap_204566)' = 0
((char*)&$heap_204566)[16]' = 0
((char*)&$heap_204566)[20]' = 0
((char*)&$heap_204566)[4]' = &$heap_204566
((char*)&$heap_204566)[8]' = 0
((char*)&$heap_204566)[116]' = 0
((char*)&$heap_204566)[12]' = 0
$heap_204567' = 1
bytes_after(&$heap_204567)' = 124
$heap_204567' is allocated by malloc
bytes_before(&$heap_204567)' = 0
((char*)&$heap_204567)[44]' = pvmmydsig
((char*)&$heap_204567)[52]' = pvmudpmtu
((char*)&$heap_204567)[56]' = 2
((char*)&$heap_204567)[72]' = 1
((char*)&$heap_204567)[76]' = 1
((char*)&$heap_204567)[80]' = &$heap_204566
((char*)&$heap_204567)[8]' = &$heap_204568
((char*)&$heap_204567)[84]' = &$heap_204564
((char*)&$heap_204567)[92]' = &$heap_204563
((char*)&$heap_204567)[100]' = 1
((char*)&$heap_204567)[108]' = 1000
((char*)&$heap_204567)[112]' = &$heap_204565
((char*)&$heap_204567)[12]' = &$heap_204569
$heap_204568' = *hn
bytes_after(&$heap_204568)' = strlen(hn) + 1
$heap_204568' is allocated by malloc
$heap_204568' is allocated
bytes_before(&$heap_204568)' = 0
strlen(&$heap_204568)' = strlen(hn)
tocttou($heap_204568)' = tocttou(*hn)
$heap_204569' = *myarchname
bytes_after(&$heap_204569)' = strlen(myarchname) + 1
$heap_204569' is allocated by malloc
$heap_204569' is allocated
bytes_before(&$heap_204569)' = 0
strlen(&$heap_204569)' = strlen(myarchname)
tocttou($heap_204569)' = tocttou(*myarchname)
bytes_after(&$heap_204570)' = 120
$heap_204570' is allocated by malloc
$heap_204570' is allocated
bytes_before(&$heap_204570)' = 0
((char*)&$heap_204570)[16]' = 0
((char*)&$heap_204570)[20]' = 0
((char*)&$heap_204570)[8]' = 0
((char*)&$heap_204570)[116]' = 0
((char*)&$heap_204570)[12]' = 0
bytes_after(&$heap_204571)' = 20
$heap_204571' is allocated by malloc
$heap_204571' is allocated
bytes_before(&$heap_204571)' = 0
((char*)&$heap_204571)[16]' = 0
((char*)&$heap_204571)[8]' = 0
((char*)&$heap_204571)[12]' = 0
$heap_204572' = &$heap_204572
bytes_after(&$heap_204572)' = 120
$heap_204572' is allocated by malloc
$heap_204572' is allocated
bytes_before(&$heap_204572)' = 0
((char*)&$heap_204572)[16]' = 0
((char*)&$heap_204572)[20]' = 0
((char*)&$heap_204572)[4]' = &$heap_204572
((char*)&$heap_204572)[8]' = 0
((char*)&$heap_204572)[116]' = 0
((char*)&$heap_204572)[12]' = 0
$heap_204573' = &$heap_204573
bytes_after(&$heap_204573)' = 120
$heap_204573' is allocated by malloc
$heap_204573' is allocated
bytes_before(&$heap_204573)' = 0
((char*)&$heap_204573)[16]' = 0
((char*)&$heap_204573)[20]' = 0
((char*)&$heap_204573)[4]' = &$heap_204573
((char*)&$heap_204573)[8]' = 0
((char*)&$heap_204573)[116]' = 0
((char*)&$heap_204573)[12]' = 0
$heap_204574' = 1
bytes_after(&$heap_204574)' = 124
$heap_204574' is allocated by malloc
bytes_before(&$heap_204574)' = 0
((char*)&$heap_204574)[44]' = pvmmydsig
((char*)&$heap_204574)[52]' = pvmudpmtu
((char*)&$heap_204574)[56]' = 2
((char*)&$heap_204574)[72]' = 1
((char*)&$heap_204574)[76]' = 1
((char*)&$heap_204574)[80]' = &$heap_204573
((char*)&$heap_204574)[8]' = &$heap_204575
((char*)&$heap_204574)[84]' = &$heap_204572
((char*)&$heap_204574)[92]' = &$heap_204570
((char*)&$heap_204574)[100]' = 1
((char*)&$heap_204574)[108]' = 1000
((char*)&$heap_204574)[112]' = &$heap_204571
((char*)&$heap_204574)[12]' = &$heap_204576
$heap_204575' = 112
bytes_after(&$heap_204575)' = 6
$heap_204575' is allocated by malloc
$heap_204575' is allocated
bytes_before(&$heap_204575)' = 0
strlen(&$heap_204575)' = 5
tocttou($heap_204575)' = tocttou(#string167)
$heap_204576' = *myarchname
bytes_after(&$heap_204576)' = strlen(myarchname) + 1
$heap_204576' is allocated by malloc
$heap_204576' is allocated
bytes_before(&$heap_204576)' = 0
strlen(&$heap_204576)' = strlen(myarchname)
tocttou($heap_204576)' = tocttou(*myarchname)
$heap_204577' = 36
bytes_after(&$heap_204577)' = 49
$heap_204577' is allocated by malloc
$heap_204577' is allocated
bytes_before(&$heap_204577)' = 0
tocttou($heap_204577)' = tocttou(#string168)
$heap_204578' = &$unknown_760009
bytes_after(&$heap_204578)' = 8
$heap_204578' is allocated by malloc
$heap_204578' is allocated
bytes_before(&$heap_204578)' = 0
((char*)&$heap_204578)[4]' = 0
$heap_204579' = 36
bytes_after(&$heap_204579)' = 23
$heap_204579' is allocated by malloc
$heap_204579' is allocated
bytes_before(&$heap_204579)' = 0
tocttou($heap_204579)' = tocttou(#string170)
hosts' = &$heap_204562
hp' = ((char*)&((char*)$heap_204562)[28])[4]
s' = 0
tmbuf.tm_sec' = &$unknown_760011




Change Warning 22081.28918 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: