Text  |   XML   |   Visible Warnings:

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

Categories: LANG.MEM.NPD CWE:476
Warning ID: 2685.2734
Similar Warnings: 2685.2737
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) */
 5355         hp->hd_arch = STRALLOC(myarchname);   /* Null Pointer Dereference (ID: 2685.2737) */
 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: 2686.2736) */
true5363         hp->hd_arch = STRALLOC(myarchname);     /* Null Pointer Dereference */
Preconditions
$param_2 <= 1
((char*)&$heap_141485)[8] >= 0
((char*)&$heap_141487)[144] >= 0
((char*)&$heap_141487)[32] != 0
$input_12 >= 0
Postconditions
((char*)$heap_141487)[32]' is freed
argc' = $param_2
argv' = $param_3
atnewline' = 1
filehosts' = 0
$heap_141484' = $input_60
bytes_after(&$heap_141484)' = $input_12 + 1
$heap_141484' is allocated by malloc
$heap_141484' is a non-heap object
bytes_before(&$heap_141484)' = 0
strlen(&$heap_141484)' = $input_12
$heap_141485' = 1
bytes_after(&$heap_141485)' = 40
$heap_141485' is allocated by malloc
$heap_141485' is allocated
bytes_before(&$heap_141485)' = 0
strlen(&$heap_141485)' = 0
((char*)&$heap_141485)[16]' = 1
((char*)&$heap_141485)[20]' = 1
((char*)&$heap_141485)[12]' = 1
$heap_141487' = 0
bytes_after(&$heap_141487)' = 200
$heap_141487' is allocated by malloc
$heap_141487' is freed
bytes_before(&$heap_141487)' = 0
strlen(&$heap_141487)' = 0
((char*)&$heap_141487)[136]' = &$heap_141489
((char*)&$heap_141487)[152]' = 1
((char*)&$heap_141487)[16]' = &$heap_141493
((char*)&$heap_141487)[168]' = 1000
((char*)&$heap_141487)[176]' = &$heap_141490
((char*)&$heap_141487)[76]' = pvmmydsig
((char*)&$heap_141487)[8]' = &$heap_141492
((char*)&$heap_141487)[84]' = pvmudpmtu
((char*)&$heap_141487)[88]' = 2
((char*)&$heap_141487)[104]' = 1
((char*)&$heap_141487)[108]' = 1
((char*)&$heap_141487)[112]' = &$heap_141488
((char*)&$heap_141487)[120]' = &$heap_141491
bytes_after(&$heap_141488)' = 184
$heap_141488' is allocated by malloc
bytes_before(&$heap_141488)' = 0
((char*)&$heap_141488)[16]' = 0
((char*)&$heap_141488)[176]' = 0
((char*)&$heap_141488)[24]' = 0
((char*)&$heap_141488)[32]' = 0
((char*)&$heap_141488)[40]' = 0
bytes_after(&$heap_141489)' = 184
$heap_141489' is allocated by malloc
bytes_before(&$heap_141489)' = 0
bytes_after(&$heap_141490)' = 32
$heap_141490' is allocated by malloc
bytes_before(&$heap_141490)' = 0
((char*)&$heap_141490)[16]' = 0
((char*)&$heap_141490)[20]' = 0
((char*)&$heap_141490)[24]' = 0
bytes_after(&$heap_141491)' = 184
$heap_141491' is allocated by malloc
bytes_before(&$heap_141491)' = 0
((char*)&$heap_141491)[176]' = 0
((char*)&$heap_141491)[32]' = 0
((char*)&$heap_141491)[40]' = 0
$heap_141492' = *$param_1
bytes_after(&$heap_141492)' = strlen($param_1) + 1
$heap_141492' is allocated by malloc
bytes_before(&$heap_141492)' = 0
strlen(&$heap_141492)' = strlen($param_1)
$heap_141493' = *myarchname
bytes_after(&$heap_141493)' = strlen(myarchname) + 1
$heap_141493' is allocated by malloc
bytes_before(&$heap_141493)' = 0
strlen(&$heap_141493)' = strlen(myarchname)
$heap_141494' = 1
bytes_after(&$heap_141494)' = 200
$heap_141494' is allocated by malloc
$heap_141494' is allocated
bytes_before(&$heap_141494)' = 0
strlen(&$heap_141494)' = 0
((char*)&$heap_141494)[136]' = &$heap_141498
((char*)&$heap_141494)[152]' = 1
((char*)&$heap_141494)[168]' = 1000
((char*)&$heap_141494)[176]' = &$heap_141497
((char*)&$heap_141494)[8]' = &$heap_141499
((char*)&$heap_141494)[88]' = 2
((char*)&$heap_141494)[104]' = 1
((char*)&$heap_141494)[108]' = 1
((char*)&$heap_141494)[112]' = &$heap_141496
((char*)&$heap_141494)[120]' = &$heap_141495
bytes_after(&$heap_141495)' = 184
$heap_141495' is allocated by malloc
$heap_141495' is allocated
bytes_before(&$heap_141495)' = 0
((char*)&$heap_141495)[16]' = 0
((char*)&$heap_141495)[176]' = 0
((char*)&$heap_141495)[24]' = 0
((char*)&$heap_141495)[32]' = 0
((char*)&$heap_141495)[40]' = 0
bytes_after(&$heap_141496)' = 184
$heap_141496' is allocated by malloc
$heap_141496' is allocated
bytes_before(&$heap_141496)' = 0
((char*)&$heap_141496)[16]' = 0
((char*)&$heap_141496)[176]' = 0
((char*)&$heap_141496)[24]' = 0
((char*)&$heap_141496)[32]' = 0
((char*)&$heap_141496)[40]' = 0
$heap_141497' = &$heap_141497
bytes_after(&$heap_141497)' = 32
$heap_141497' is allocated by malloc
$heap_141497' is allocated
bytes_before(&$heap_141497)' = 0
((char*)&$heap_141497)[16]' = 0
((char*)&$heap_141497)[20]' = 0
((char*)&$heap_141497)[24]' = 0
((char*)&$heap_141497)[8]' = &$heap_141497
bytes_after(&$heap_141498)' = 184
$heap_141498' is allocated by malloc
$heap_141498' is allocated
bytes_before(&$heap_141498)' = 0
((char*)&$heap_141498)[16]' = 0
((char*)&$heap_141498)[176]' = 0
((char*)&$heap_141498)[24]' = 0
((char*)&$heap_141498)[32]' = 0
((char*)&$heap_141498)[40]' = 0
$heap_141499' = 112
bytes_after(&$heap_141499)' = 6
$heap_141499' is allocated by malloc
$heap_141499' is allocated
bytes_before(&$heap_141499)' = 0
strlen(&$heap_141499)' = 5
hn' = $param_1
hosts' = &$heap_141485
hp' = &$heap_141494
s' = &$heap_141484
tmbuf.tm_sec' = &$unknown_872003




Change Warning 2685.2734 : Null Pointer Dereference

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

Priority:
State:
Finding:
Owner:
Note: