Text  |   XML   |   Visible Warnings:

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

Categories: LANG.MEM.NPD CWE:476
Warning ID: 2670.2715
Similar Warnings: 2670.2718
Procedure: slave_config
Trace: View
Modified: Wed Sep 2 12:42:52 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 slave_config
 5449 slave_config(hn, argc, argv) 
 5450         char *hn;
 5451         int argc;
 5452         char **argv;
 5453 {
 5454         int lh;                 /* local host index */ 
 5455         int mh;                 /* master host index */ 
 5456         struct hostd *hp;
 5457         int i, j;
 5458         int ac;
 5459         int ms = 0;             /* manual (humanoid) startup */ 
 5460 #ifndef WIN32 
 5461         int dof = 1;            /* fork, exit parent (default) */ 
 5462 #else 
 5463         int dof = 0; 
 5464 #endif 
 5465         int bad = 0;
 5466         char *p;
 5467         char *s;
 5468  
 5469         for (i = j = ac = 1; i < argc; i++) {
 5470                 if (argv[i][0] == '-') {
 5471                         switch (argv[i][1]) {
 5472  
 5473                         case 'S': 
 5474                                 ms = 1;
 5475                                 break;
 5476  
 5477                         case 'f': 
 5478                                 dof = 0;
 5479                                 break;
 5480  
 5481                         default: 
 5482                                 pvmlogprintf("slave_config() unknown switch: %s\n", argv[i]);
 5483                                 bad++;
 5484                         }
 5485  
 5486                 } else {
 5487                         argv[j++] = argv[i];
 5488                         ac++;
 5489                 }
 5490         }
 5491         argc = ac;
 5492  
 5493         if (bad || argc != 6) {
 5494                 pvmlogerror("slave_config: bad args\n");
 5495                 pvmbailout(0);
 5496         }
 5497  
 5498         mh = atoi(argv[1]);
 5499         lh = atoi(argv[4]);
 5500         hosts = ht_new(1);
 5501         hosts->ht_serial = 1;
 5502         hosts->ht_master = mh;
 5503         hosts->ht_cons = mh;
 5504         hosts->ht_local = lh;
 5505  
 5506         hp = hd_new(mh);
 5507         hp->hd_name = STRALLOC("?");   /* Null Pointer Dereference (ID: 2673.2721) */
 5508         hex_inadport(argv[2], &hp->hd_sad);
 5509         hp->hd_mtu = atoi(argv[3]);
 5510         ht_insert(hosts, hp);
 5511         hd_unref(hp);
 5512  
 5513         hp = hd_new(0);
 5514         hp->hd_name = STRALLOC("pvmd'");   /* Null Pointer Dereference (ID: 2672.2720) */
 5515         hp->hd_arch = STRALLOC(myarchname);   /* Null Pointer Dereference (ID: 2670.2718) */
 5516         hp->hd_mtu = pvmudpmtu;
 5517         hp->hd_dsig = pvmmydsig;
 5518         hex_inadport(argv[5], &hp->hd_sad);
 5519         ht_insert(hosts, hp);
 5520         hd_unref(hp);
 5521  
 5522         hp = hd_new(lh);
 5523         hp->hd_name = STRALLOC(hn);   /* Null Pointer Dereference (ID: 2671.2717) */
true5524         hp->hd_arch = STRALLOC(myarchname);     /* Null Pointer Dereference */
Preconditions
$param_2 >= 3
&$unknown_808933 = 0
((char*)&$heap_81073)[8] >= 0
((char*)&$heap_81074)[144] >= 0
((char*)&$heap_81074)[16] >= 0
((char*)&$heap_81074)[32] = 0
((char*)&$heap_81079)[144] >= 0
Postconditions
ac' = 6
argc' = 6
argv' = $param_3
atnewline' = 0
bad' = 0
$heap_81073' = 1
bytes_after(&$heap_81073)' = 40
$heap_81073' is allocated by malloc
$heap_81073' is allocated
bytes_before(&$heap_81073)' = 0
strlen(&$heap_81073)' = 0
((char*)&$heap_81073)[16]' = $input_12
((char*)&$heap_81073)[20]' = $input_22668
((char*)&$heap_81073)[12]' = $input_12
$heap_81074' = 0
bytes_after(&$heap_81074)' = 200
$heap_81074' is allocated by malloc
$heap_81074' is freed
bytes_before(&$heap_81074)' = 0
strlen(&$heap_81074)' = 0
((char*)&$heap_81074)[136]' = &$heap_81077
((char*)&$heap_81074)[152]' = 1
((char*)&$heap_81074)[168]' = 1000
((char*)&$heap_81074)[176]' = 0
((char*)&$heap_81074)[8]' = &$heap_81078
((char*)&$heap_81074)[84]' = $input_22676
((char*)&$heap_81074)[88]' = 2
((char*)&$heap_81074)[104]' = 1
((char*)&$heap_81074)[108]' = 1
((char*)&$heap_81074)[112]' = &$heap_81075
((char*)&$heap_81074)[120]' = &$heap_81076
bytes_after(&$heap_81075)' = 184
$heap_81075' is allocated by malloc
bytes_before(&$heap_81075)' = 0
((char*)&$heap_81075)[16]' = 0
((char*)&$heap_81075)[176]' = 0
((char*)&$heap_81075)[24]' = 0
((char*)&$heap_81075)[32]' = 0
((char*)&$heap_81075)[40]' = 0
bytes_after(&$heap_81076)' = 184
$heap_81076' is allocated by malloc
bytes_before(&$heap_81076)' = 0
((char*)&$heap_81076)[176]' = 0
((char*)&$heap_81076)[32]' = 0
((char*)&$heap_81076)[40]' = 0
$heap_81077' = &$heap_81077
bytes_after(&$heap_81077)' = 184
$heap_81077' is allocated by malloc
bytes_before(&$heap_81077)' = 0
((char*)&$heap_81077)[176]' = 0
((char*)&$heap_81077)[32]' = 0
((char*)&$heap_81077)[40]' = 0
((char*)&$heap_81077)[8]' = &$heap_81077
$heap_81078' = 63
bytes_after(&$heap_81078)' = 2
$heap_81078' is allocated by malloc
bytes_before(&$heap_81078)' = 0
strlen(&$heap_81078)' = 1
$heap_81079' = 0
bytes_after(&$heap_81079)' = 200
$heap_81079' is allocated by malloc
$heap_81079' is freed
bytes_before(&$heap_81079)' = 0
strlen(&$heap_81079)' = 0
((char*)&$heap_81079)[136]' = &$heap_81080
((char*)&$heap_81079)[152]' = 1
((char*)&$heap_81079)[16]' = &$heap_81085
((char*)&$heap_81079)[168]' = 1000
((char*)&$heap_81079)[176]' = &$heap_81081
((char*)&$heap_81079)[76]' = pvmmydsig
((char*)&$heap_81079)[8]' = &$heap_81084
((char*)&$heap_81079)[84]' = pvmudpmtu
((char*)&$heap_81079)[88]' = 2
((char*)&$heap_81079)[104]' = 1
((char*)&$heap_81079)[108]' = 1
((char*)&$heap_81079)[112]' = &$heap_81083
((char*)&$heap_81079)[120]' = &$heap_81082
bytes_after(&$heap_81080)' = 184
$heap_81080' is allocated by malloc
bytes_before(&$heap_81080)' = 0
((char*)&$heap_81080)[176]' = 0
((char*)&$heap_81080)[32]' = 0
((char*)&$heap_81080)[40]' = 0
bytes_after(&$heap_81081)' = 32
$heap_81081' is allocated by malloc
bytes_before(&$heap_81081)' = 0
((char*)&$heap_81081)[16]' = 0
((char*)&$heap_81081)[20]' = 0
((char*)&$heap_81081)[24]' = 0
bytes_after(&$heap_81082)' = 184
$heap_81082' is allocated by malloc
bytes_before(&$heap_81082)' = 0
((char*)&$heap_81082)[176]' = 0
((char*)&$heap_81082)[32]' = 0
((char*)&$heap_81082)[40]' = 0
bytes_after(&$heap_81083)' = 184
$heap_81083' is allocated by malloc
bytes_before(&$heap_81083)' = 0
((char*)&$heap_81083)[16]' = 0
((char*)&$heap_81083)[176]' = 0
((char*)&$heap_81083)[24]' = 0
((char*)&$heap_81083)[32]' = 0
((char*)&$heap_81083)[40]' = 0
$heap_81084' = 112
bytes_after(&$heap_81084)' = 6
$heap_81084' is allocated by malloc
bytes_before(&$heap_81084)' = 0
strlen(&$heap_81084)' = 5
$heap_81085' = *myarchname
bytes_after(&$heap_81085)' = strlen(myarchname) + 1
$heap_81085' is allocated by malloc
bytes_before(&$heap_81085)' = 0
strlen(&$heap_81085)' = strlen(myarchname)
$heap_81086' = 1
bytes_after(&$heap_81086)' = 200
$heap_81086' is allocated by malloc
$heap_81086' is allocated
bytes_before(&$heap_81086)' = 0
strlen(&$heap_81086)' = 0
((char*)&$heap_81086)[136]' = &$heap_81087
((char*)&$heap_81086)[152]' = 1
((char*)&$heap_81086)[168]' = 1000
((char*)&$heap_81086)[176]' = &$heap_81088
((char*)&$heap_81086)[8]' = &$heap_81091
((char*)&$heap_81086)[88]' = 2
((char*)&$heap_81086)[104]' = 1
((char*)&$heap_81086)[108]' = 1
((char*)&$heap_81086)[112]' = &$heap_81089
((char*)&$heap_81086)[120]' = &$heap_81090
bytes_after(&$heap_81087)' = 184
$heap_81087' is allocated by malloc
$heap_81087' is allocated
bytes_before(&$heap_81087)' = 0
((char*)&$heap_81087)[16]' = 0
((char*)&$heap_81087)[176]' = 0
((char*)&$heap_81087)[24]' = 0
((char*)&$heap_81087)[32]' = 0
((char*)&$heap_81087)[40]' = 0
$heap_81088' = &$heap_81088
bytes_after(&$heap_81088)' = 32
$heap_81088' is allocated by malloc
$heap_81088' is allocated
bytes_before(&$heap_81088)' = 0
((char*)&$heap_81088)[16]' = 0
((char*)&$heap_81088)[20]' = 0
((char*)&$heap_81088)[24]' = 0
((char*)&$heap_81088)[8]' = &$heap_81088
bytes_after(&$heap_81089)' = 184
$heap_81089' is allocated by malloc
$heap_81089' is allocated
bytes_before(&$heap_81089)' = 0
((char*)&$heap_81089)[16]' = 0
((char*)&$heap_81089)[176]' = 0
((char*)&$heap_81089)[24]' = 0
((char*)&$heap_81089)[32]' = 0
((char*)&$heap_81089)[40]' = 0
bytes_after(&$heap_81090)' = 184
$heap_81090' is allocated by malloc
$heap_81090' is allocated
bytes_before(&$heap_81090)' = 0
((char*)&$heap_81090)[16]' = 0
((char*)&$heap_81090)[176]' = 0
((char*)&$heap_81090)[24]' = 0
((char*)&$heap_81090)[32]' = 0
((char*)&$heap_81090)[40]' = 0
$heap_81091' = *$param_1
bytes_after(&$heap_81091)' = strlen($param_1) + 1
$heap_81091' is allocated by malloc
$heap_81091' is allocated
bytes_before(&$heap_81091)' = 0
strlen(&$heap_81091)' = strlen($param_1)
hn' = $param_1
hosts' = &$heap_81073
hp' = &$heap_81086
i' = $param_2
lh' = $input_22668
mh' = $input_12
tmbuf.tm_sec' = &$unknown_808920




Change Warning 2670.2715 : Null Pointer Dereference

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

Priority:
State:
Finding:
Owner:
Note: