Text  |   XML   |   Visible Warnings:

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

Categories: LANG.MEM.NPD CWE:476
Warning ID: 264.28926
Similar Warnings: 264.28927
Procedure: master_config
Trace: view
Modified: Thu Nov 26 11:28:40 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  
true5361         hp = hd_new(0);
hp <= 40955362         hp->hd_name = STRALLOC("pvmd'");     /* Null Pointer Dereference */
Preconditions
argc <= 1
((char*)&$heap_224367)[20] != 0
((char*)&$heap_224367)[96] >= 0
$input_12 >= 0
Postconditions
((char*)$heap_224367)[20]' is freed
atnewline' = 1
errno' != 0
filehosts' = 0
$heap_224361' = $input_444
bytes_after(&$heap_224361)' = $input_12 + 1
$heap_224361' is allocated by malloc
$heap_224361' is a non-heap object
bytes_before(&$heap_224361)' = 0
strlen(&$heap_224361)' = $input_12
$heap_224363' = 1
bytes_after(&$heap_224363)' = 32
$heap_224363' is allocated by malloc
$heap_224363' is allocated
bytes_before(&$heap_224363)' = 0
((char*)&$heap_224363)[16]' = 1
((char*)&$heap_224363)[20]' = 1
((char*)&$heap_224363)[12]' = 1
bytes_after(&$heap_224364)' = 120
$heap_224364' is allocated by malloc
bytes_before(&$heap_224364)' = 0
((char*)&$heap_224364)[16]' = 0
((char*)&$heap_224364)[20]' = 0
((char*)&$heap_224364)[116]' = 0
bytes_after(&$heap_224365)' = 120
$heap_224365' is allocated by malloc
bytes_before(&$heap_224365)' = 0
((char*)&$heap_224365)[16]' = 0
((char*)&$heap_224365)[20]' = 0
((char*)&$heap_224365)[116]' = 0
bytes_after(&$heap_224366)' = 20
$heap_224366' is allocated by malloc
bytes_before(&$heap_224366)' = 0
((char*)&$heap_224366)[16]' = 0
((char*)&$heap_224366)[8]' = 0
((char*)&$heap_224366)[12]' = 0
$heap_224367' = 0
bytes_after(&$heap_224367)' = 124
$heap_224367' is allocated by malloc
$heap_224367' is freed
bytes_before(&$heap_224367)' = 0
((char*)&$heap_224367)[44]' = pvmmydsig
((char*)&$heap_224367)[52]' = pvmudpmtu
((char*)&$heap_224367)[56]' = 2
((char*)&$heap_224367)[72]' = 1
((char*)&$heap_224367)[76]' = 1
((char*)&$heap_224367)[80]' = &$heap_224368
((char*)&$heap_224367)[8]' = &$heap_224369
((char*)&$heap_224367)[84]' = &$heap_224365
((char*)&$heap_224367)[92]' = &$heap_224364
((char*)&$heap_224367)[100]' = 1
((char*)&$heap_224367)[108]' = 1000
((char*)&$heap_224367)[112]' = &$heap_224366
((char*)&$heap_224367)[12]' = &$heap_224370
bytes_after(&$heap_224368)' = 120
$heap_224368' is allocated by malloc
bytes_before(&$heap_224368)' = 0
((char*)&$heap_224368)[16]' = 0
((char*)&$heap_224368)[20]' = 0
((char*)&$heap_224368)[8]' = 0
((char*)&$heap_224368)[116]' = 0
((char*)&$heap_224368)[12]' = 0
$heap_224369' = *hn
bytes_after(&$heap_224369)' = strlen(hn) + 1
$heap_224369' is allocated by malloc
bytes_before(&$heap_224369)' = 0
strlen(&$heap_224369)' = strlen(hn)
tocttou($heap_224369)' = tocttou(*hn)
$heap_224370' = *myarchname
bytes_after(&$heap_224370)' = strlen(myarchname) + 1
$heap_224370' is allocated by malloc
bytes_before(&$heap_224370)' = 0
strlen(&$heap_224370)' = strlen(myarchname)
tocttou($heap_224370)' = tocttou(*myarchname)
$heap_224371' = 112
bytes_after(&$heap_224371)' = 6
$heap_224371' is allocated by malloc
$heap_224371' is allocated
bytes_before(&$heap_224371)' = 0
strlen(&$heap_224371)' = 5
tocttou($heap_224371)' = tocttou(#string167)
hosts' = &$heap_224363
hp' = 0
s' = &$heap_224361
tmbuf.tm_sec' = &$unknown_766800




Change Warning 264.28926 : Null Pointer Dereference

Because they are very similar, this warning shares annotations with warning 264.28927.

Priority:
State:
Finding:
Owner:
Note: