Text  |   XML   |   Visible Warnings:

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

Categories: LANG.MEM.NPD CWE:476
Warning ID: 22087.28924
Procedure: master_config
Trace: view
Modified: Thu Nov 26 11:28:39 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")))
true5382                         hp->hd_epath = STRALLOC(s);     /* Null Pointer Dereference */
Preconditions
argc = 2
((char*)&((char*)((char*)$heap_221150)[28])[4])[24] = 0
((char*)&$heap_221161)[20] = 0
((char*)&$heap_221161)[96] >= 0
$input_12 >= 0
Postconditions
atnewline' = 1
errno' != 0
filehosts' = 0
$heap_221150' = 1
bytes_after(&$heap_221150)' = 32
$heap_221150' is allocated by malloc
$heap_221150' is allocated
bytes_before(&$heap_221150)' = 0
((char*)&$heap_221150)[16]' = 1
((char*)&$heap_221150)[20]' = 1
((char*)&$heap_221150)[8]' = ((char*)&$heap_221150)[8] + 1
((char*)&$heap_221150)[12]' = 1
bytes_after(&$heap_221151)' = 120
$heap_221151' is allocated by malloc
$heap_221151' is allocated
bytes_before(&$heap_221151)' = 0
((char*)&$heap_221151)[16]' = 0
((char*)&$heap_221151)[20]' = 0
((char*)&$heap_221151)[8]' = 0
((char*)&$heap_221151)[116]' = 0
((char*)&$heap_221151)[12]' = 0
bytes_after(&$heap_221152)' = 120
$heap_221152' is allocated by malloc
$heap_221152' is allocated
bytes_before(&$heap_221152)' = 0
((char*)&$heap_221152)[16]' = 0
((char*)&$heap_221152)[20]' = 0
((char*)&$heap_221152)[8]' = 0
((char*)&$heap_221152)[116]' = 0
((char*)&$heap_221152)[12]' = 0
bytes_after(&$heap_221153)' = 20
$heap_221153' is allocated by malloc
$heap_221153' is allocated
bytes_before(&$heap_221153)' = 0
((char*)&$heap_221153)[16]' = 0
((char*)&$heap_221153)[8]' = 0
((char*)&$heap_221153)[12]' = 0
$heap_221154' = 1
bytes_after(&$heap_221154)' = 124
$heap_221154' is allocated by malloc
bytes_before(&$heap_221154)' = 0
((char*)&$heap_221154)[44]' = pvmmydsig
((char*)&$heap_221154)[52]' = pvmudpmtu
((char*)&$heap_221154)[56]' = 2
((char*)&$heap_221154)[72]' = 1
((char*)&$heap_221154)[76]' = 1
((char*)&$heap_221154)[80]' = &$heap_221155
((char*)&$heap_221154)[8]' = &$heap_221156
((char*)&$heap_221154)[84]' = &$heap_221152
((char*)&$heap_221154)[92]' = &$heap_221151
((char*)&$heap_221154)[100]' = 1
((char*)&$heap_221154)[108]' = 1000
((char*)&$heap_221154)[112]' = &$heap_221153
((char*)&$heap_221154)[12]' = &$heap_221157
$heap_221155' = &$heap_221155
bytes_after(&$heap_221155)' = 120
$heap_221155' is allocated by malloc
$heap_221155' is allocated
bytes_before(&$heap_221155)' = 0
((char*)&$heap_221155)[16]' = 0
((char*)&$heap_221155)[20]' = 0
((char*)&$heap_221155)[4]' = &$heap_221155
((char*)&$heap_221155)[8]' = 0
((char*)&$heap_221155)[116]' = 0
((char*)&$heap_221155)[12]' = 0
$heap_221156' = *hn
bytes_after(&$heap_221156)' = strlen(hn) + 1
$heap_221156' is allocated by malloc
$heap_221156' is allocated
bytes_before(&$heap_221156)' = 0
strlen(&$heap_221156)' = strlen(hn)
tocttou($heap_221156)' = tocttou(*hn)
$heap_221157' = *myarchname
bytes_after(&$heap_221157)' = strlen(myarchname) + 1
$heap_221157' is allocated by malloc
$heap_221157' is allocated
bytes_before(&$heap_221157)' = 0
strlen(&$heap_221157)' = strlen(myarchname)
tocttou($heap_221157)' = tocttou(*myarchname)
bytes_after(&$heap_221158)' = 120
$heap_221158' is allocated by malloc
bytes_before(&$heap_221158)' = 0
((char*)&$heap_221158)[16]' = 0
((char*)&$heap_221158)[20]' = 0
((char*)&$heap_221158)[116]' = 0
$heap_221159' = &$heap_221159
bytes_after(&$heap_221159)' = 120
$heap_221159' is allocated by malloc
bytes_before(&$heap_221159)' = 0
((char*)&$heap_221159)[16]' = 0
((char*)&$heap_221159)[20]' = 0
((char*)&$heap_221159)[4]' = &$heap_221159
((char*)&$heap_221159)[116]' = 0
bytes_after(&$heap_221160)' = 20
$heap_221160' is allocated by malloc
bytes_before(&$heap_221160)' = 0
((char*)&$heap_221160)[16]' = 0
((char*)&$heap_221160)[8]' = 0
((char*)&$heap_221160)[12]' = 0
$heap_221161' = 0
bytes_after(&$heap_221161)' = 124
$heap_221161' is allocated by malloc
$heap_221161' is freed
bytes_before(&$heap_221161)' = 0
((char*)&$heap_221161)[44]' = pvmmydsig
((char*)&$heap_221161)[52]' = pvmudpmtu
((char*)&$heap_221161)[56]' = 2
((char*)&$heap_221161)[72]' = 1
((char*)&$heap_221161)[76]' = 1
((char*)&$heap_221161)[80]' = &$heap_221162
((char*)&$heap_221161)[8]' = &$heap_221163
((char*)&$heap_221161)[84]' = &$heap_221159
((char*)&$heap_221161)[92]' = &$heap_221158
((char*)&$heap_221161)[100]' = 1
((char*)&$heap_221161)[108]' = 1000
((char*)&$heap_221161)[112]' = &$heap_221160
((char*)&$heap_221161)[12]' = &$heap_221164
$heap_221162' = &$heap_221162
bytes_after(&$heap_221162)' = 120
$heap_221162' is allocated by malloc
bytes_before(&$heap_221162)' = 0
((char*)&$heap_221162)[16]' = 0
((char*)&$heap_221162)[20]' = 0
((char*)&$heap_221162)[4]' = &$heap_221162
((char*)&$heap_221162)[8]' = 0
((char*)&$heap_221162)[116]' = 0
((char*)&$heap_221162)[12]' = 0
$heap_221163' = 112
bytes_after(&$heap_221163)' = 6
$heap_221163' is allocated by malloc
bytes_before(&$heap_221163)' = 0
strlen(&$heap_221163)' = 5
tocttou($heap_221163)' = tocttou(#string167)
$heap_221164' = *myarchname
bytes_after(&$heap_221164)' = strlen(myarchname) + 1
$heap_221164' is allocated by malloc
bytes_before(&$heap_221164)' = 0
strlen(&$heap_221164)' = strlen(myarchname)
tocttou($heap_221164)' = tocttou(*myarchname)
$heap_221165' = $input_444
bytes_after(&$heap_221165)' = $input_12 + 1
$heap_221165' is allocated by malloc
$heap_221165' is a non-heap object
bytes_before(&$heap_221165)' = 0
strlen(&$heap_221165)' = $input_12
hosts' = &$heap_221150
hp' = ((char*)&((char*)$heap_221150)[28])[4]
s' = &$heap_221165




Change Warning 22087.28924 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: