Text  |   XML   |   Visible Warnings:

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

Categories: LANG.MEM.NPD CWE:476
Warning ID: 263.28925
Similar Warnings: 263.28928
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  
 5361         hp = hd_new(0);
 5362         hp->hd_name = STRALLOC("pvmd'");   /* Null Pointer Dereference (ID: 264.28927) */
true5363         hp->hd_arch = STRALLOC(myarchname);     /* Null Pointer Dereference */
Preconditions
argc <= 1
((char*)&$heap_222633)[20] != 0
((char*)&$heap_222633)[96] >= 0
$input_12 >= 0
Postconditions
((char*)$heap_222633)[20]' is freed
errno' != 0
filehosts' = &$unknown_766703
$heap_222629' = $input_444
bytes_after(&$heap_222629)' = $input_12 + 1
$heap_222629' is allocated by malloc
$heap_222629' is a non-heap object
bytes_before(&$heap_222629)' = 0
strlen(&$heap_222629)' = $input_12
$heap_222631' = 1
bytes_after(&$heap_222631)' = 32
$heap_222631' is allocated by malloc
$heap_222631' is allocated
bytes_before(&$heap_222631)' = 0
((char*)&$heap_222631)[16]' = 1
((char*)&$heap_222631)[20]' = 1
((char*)&$heap_222631)[12]' = 1
bytes_after(&$heap_222632)' = 120
$heap_222632' is allocated by malloc
bytes_before(&$heap_222632)' = 0
((char*)&$heap_222632)[16]' = 0
((char*)&$heap_222632)[20]' = 0
((char*)&$heap_222632)[8]' = 0
((char*)&$heap_222632)[116]' = 0
((char*)&$heap_222632)[12]' = 0
$heap_222633' = 0
bytes_after(&$heap_222633)' = 124
$heap_222633' is allocated by malloc
$heap_222633' is freed
bytes_before(&$heap_222633)' = 0
((char*)&$heap_222633)[44]' = pvmmydsig
((char*)&$heap_222633)[52]' = pvmudpmtu
((char*)&$heap_222633)[56]' = 2
((char*)&$heap_222633)[72]' = 1
((char*)&$heap_222633)[76]' = 1
((char*)&$heap_222633)[80]' = &$heap_222632
((char*)&$heap_222633)[8]' = &$heap_222636
((char*)&$heap_222633)[84]' = &$heap_222635
((char*)&$heap_222633)[92]' = &$heap_222634
((char*)&$heap_222633)[100]' = 1
((char*)&$heap_222633)[108]' = 1000
((char*)&$heap_222633)[112]' = 0
((char*)&$heap_222633)[12]' = &$heap_222637
bytes_after(&$heap_222634)' = 120
$heap_222634' is allocated by malloc
bytes_before(&$heap_222634)' = 0
((char*)&$heap_222634)[16]' = 0
((char*)&$heap_222634)[20]' = 0
((char*)&$heap_222634)[116]' = 0
bytes_after(&$heap_222635)' = 120
$heap_222635' is allocated by malloc
bytes_before(&$heap_222635)' = 0
((char*)&$heap_222635)[16]' = 0
((char*)&$heap_222635)[20]' = 0
((char*)&$heap_222635)[116]' = 0
$heap_222636' = *hn
bytes_after(&$heap_222636)' = strlen(hn) + 1
$heap_222636' is allocated by malloc
bytes_before(&$heap_222636)' = 0
strlen(&$heap_222636)' = strlen(hn)
tocttou($heap_222636)' = tocttou(*hn)
$heap_222637' = *myarchname
bytes_after(&$heap_222637)' = strlen(myarchname) + 1
$heap_222637' is allocated by malloc
bytes_before(&$heap_222637)' = 0
strlen(&$heap_222637)' = strlen(myarchname)
tocttou($heap_222637)' = tocttou(*myarchname)
bytes_after(&$heap_222638)' = 120
$heap_222638' is allocated by malloc
$heap_222638' is allocated
bytes_before(&$heap_222638)' = 0
((char*)&$heap_222638)[16]' = 0
((char*)&$heap_222638)[20]' = 0
((char*)&$heap_222638)[8]' = 0
((char*)&$heap_222638)[116]' = 0
((char*)&$heap_222638)[12]' = 0
bytes_after(&$heap_222639)' = 120
$heap_222639' is allocated by malloc
$heap_222639' is allocated
bytes_before(&$heap_222639)' = 0
((char*)&$heap_222639)[16]' = 0
((char*)&$heap_222639)[20]' = 0
((char*)&$heap_222639)[8]' = 0
((char*)&$heap_222639)[116]' = 0
((char*)&$heap_222639)[12]' = 0
bytes_after(&$heap_222640)' = 20
$heap_222640' is allocated by malloc
$heap_222640' is allocated
bytes_before(&$heap_222640)' = 0
((char*)&$heap_222640)[16]' = 0
((char*)&$heap_222640)[8]' = 0
((char*)&$heap_222640)[12]' = 0
$heap_222641' = 1
bytes_after(&$heap_222641)' = 124
$heap_222641' is allocated by malloc
$heap_222641' is allocated
bytes_before(&$heap_222641)' = 0
((char*)&$heap_222641)[56]' = 2
((char*)&$heap_222641)[72]' = 1
((char*)&$heap_222641)[76]' = 1
((char*)&$heap_222641)[80]' = &$heap_222642
((char*)&$heap_222641)[8]' = &$heap_222643
((char*)&$heap_222641)[84]' = &$heap_222639
((char*)&$heap_222641)[92]' = &$heap_222638
((char*)&$heap_222641)[100]' = 1
((char*)&$heap_222641)[108]' = 1000
((char*)&$heap_222641)[112]' = &$heap_222640
$heap_222642' = &$heap_222642
bytes_after(&$heap_222642)' = 120
$heap_222642' is allocated by malloc
$heap_222642' is allocated
bytes_before(&$heap_222642)' = 0
((char*)&$heap_222642)[16]' = 0
((char*)&$heap_222642)[20]' = 0
((char*)&$heap_222642)[4]' = &$heap_222642
((char*)&$heap_222642)[8]' = 0
((char*)&$heap_222642)[116]' = 0
((char*)&$heap_222642)[12]' = 0
$heap_222643' = 112
bytes_after(&$heap_222643)' = 6
$heap_222643' is allocated by malloc
$heap_222643' is allocated
bytes_before(&$heap_222643)' = 0
strlen(&$heap_222643)' = 5
tocttou($heap_222643)' = tocttou(#string167)
hosts' = &$heap_222631
hp' = &$heap_222641
s' = &$heap_222629




Change Warning 263.28925 : Null Pointer Dereference

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

Priority:
State:
Finding:
Owner:
Note: