Text  |   XML   |   Visible Warnings:

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

Categories: LANG.MEM.NPD CWE:476
Warning ID: 2685.2737
Similar Warnings: 2685.2734
Procedure: master_config
Trace: View
Modified: Wed Sep 2 12:43:22 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) */
true5355         hp->hd_arch = STRALLOC(myarchname);     /* Null Pointer Dereference */
Preconditions
$param_2 <= 1
$input_12 >= 0
Postconditions
argc' = $param_2
argv' = $param_3
atnewline' = 1
filehosts' = 0
$heap_145522' = $input_60
bytes_after(&$heap_145522)' = $input_12 + 1
$heap_145522' is allocated by malloc
$heap_145522' is a non-heap object
bytes_before(&$heap_145522)' = 0
strlen(&$heap_145522)' = $input_12
$heap_145523' = 1
bytes_after(&$heap_145523)' = 40
$heap_145523' is allocated by malloc
$heap_145523' is allocated
bytes_before(&$heap_145523)' = 0
strlen(&$heap_145523)' = 0
((char*)&$heap_145523)[16]' = 1
((char*)&$heap_145523)[20]' = 1
((char*)&$heap_145523)[32]' = &$heap_145524
((char*)&$heap_145523)[4]' = 1
((char*)&$heap_145523)[12]' = 1
$heap_145524' = 0
bytes_after(&$heap_145524)' = 16
$heap_145524' is allocated by malloc
$heap_145524' is allocated
bytes_before(&$heap_145524)' = 0
strlen(&$heap_145524)' = 0
$heap_145525' = 1
bytes_after(&$heap_145525)' = 200
$heap_145525' is allocated by malloc
$heap_145525' is allocated
bytes_before(&$heap_145525)' = 0
strlen(&$heap_145525)' = 0
((char*)&$heap_145525)[136]' = &$heap_145527
((char*)&$heap_145525)[152]' = 1
((char*)&$heap_145525)[168]' = 1000
((char*)&$heap_145525)[176]' = &$heap_145528
((char*)&$heap_145525)[8]' = &$heap_145530
((char*)&$heap_145525)[88]' = 2
((char*)&$heap_145525)[104]' = 1
((char*)&$heap_145525)[108]' = 1
((char*)&$heap_145525)[112]' = &$heap_145526
((char*)&$heap_145525)[120]' = &$heap_145529
bytes_after(&$heap_145526)' = 184
$heap_145526' is allocated by malloc
$heap_145526' is allocated
bytes_before(&$heap_145526)' = 0
((char*)&$heap_145526)[16]' = 0
((char*)&$heap_145526)[176]' = 0
((char*)&$heap_145526)[24]' = 0
((char*)&$heap_145526)[32]' = 0
((char*)&$heap_145526)[40]' = 0
$heap_145527' = &$heap_145527
bytes_after(&$heap_145527)' = 184
$heap_145527' is allocated by malloc
$heap_145527' is allocated
bytes_before(&$heap_145527)' = 0
((char*)&$heap_145527)[16]' = 0
((char*)&$heap_145527)[176]' = 0
((char*)&$heap_145527)[24]' = 0
((char*)&$heap_145527)[32]' = 0
((char*)&$heap_145527)[40]' = 0
((char*)&$heap_145527)[8]' = &$heap_145527
bytes_after(&$heap_145528)' = 32
$heap_145528' is allocated by malloc
$heap_145528' is allocated
bytes_before(&$heap_145528)' = 0
((char*)&$heap_145528)[16]' = 0
((char*)&$heap_145528)[20]' = 0
((char*)&$heap_145528)[24]' = 0
bytes_after(&$heap_145529)' = 184
$heap_145529' is allocated by malloc
$heap_145529' is allocated
bytes_before(&$heap_145529)' = 0
((char*)&$heap_145529)[16]' = 0
((char*)&$heap_145529)[176]' = 0
((char*)&$heap_145529)[24]' = 0
((char*)&$heap_145529)[32]' = 0
((char*)&$heap_145529)[40]' = 0
$heap_145530' = *$param_1
bytes_after(&$heap_145530)' = strlen($param_1) + 1
$heap_145530' is allocated by malloc
$heap_145530' is allocated
bytes_before(&$heap_145530)' = 0
strlen(&$heap_145530)' = strlen($param_1)
hn' = $param_1
hosts' = &$heap_145523
hp' = &$heap_145525
s' = &$heap_145522
tmbuf.tm_sec' = &$unknown_873528




Change Warning 2685.2737 : Null Pointer Dereference

Because they are very similar, this warning shares annotations with warning 2685.2734.
CodeSonar has selected warning 2685.2734 to represent this group of similar warnings. In order to edit this group, you must edit warning 2685.2734.