Text  |   XML   |   Visible Warnings:

Pvm : Pvm analysis 1 : Buffer Overrun  at pvmd.c:4836

Categories: LANG.MEM.BO CWE:120 CWE:121 CWE:122 CWE:126
Warning ID: 2668.2713
Procedure: mksocs
Trace: View
Modified: Wed Sep 2 12:42:48 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
$input_18716 >= ( 8 * bytes_after(((char*)&$heap_67962)[32]) - 63 ) / 645449 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;
$input_18732 >= ( 8 * bytes_after(((char*)&$heap_67986)[32]) - 63 ) / 645459         int ms = 0;             /* manual (humanoid) startup */ 
 5460 #ifndef WIN32 
$input_18748 >= ( 8 * bytes_after(((char*)&$heap_68010)[32]) - 63 ) / 645461         int dof = 1;            /* fork, exit parent (default) */ 
 5462 #else 
 5463         int dof = 0; 
 5464 #endif 
$input_18764 >= ( 8 * bytes_after(((char*)&$heap_68034)[32]) - 63 ) / 645465         int bad = 0;
 5466         char *p;
 5467         char *s;
 5468  
$input_18780 >= ( 8 * bytes_after(((char*)&$heap_68058)[32]) - 63 ) / 645469         for (i = j = ac = 1; i < argc; i++) {
$input_18860 >= ( 8 * bytes_after(((char*)&$heap_68178)[32]) - 63 ) / 645470                 if (argv[i][0] == '-') {
$input_18876 >= ( 8 * bytes_after(((char*)&$heap_68202)[32]) - 63 ) / 645471                         switch (argv[i][1]) {
 5472  
 5473                         case 'S': 
 5474                                 ms = 1;
 5475                                 break;
 5476  
 5477                         case 'f': 
 5478                                 dof = 0;
 5479                                 break;
 5480  
$input_18892 >= ( 8 * bytes_after(((char*)&$heap_68226)[32]) - 63 ) / 645481                         default: 
$input_18908 >= ( 8 * bytes_after(((char*)&$heap_68250)[32]) - 63 ) / 645482                                 pvmlogprintf("slave_config() unknown switch: %s\n", argv[i]);
$input_19580 >= ( 8 * bytes_after(((char*)&$heap_69258)[32]) - 63 ) / 645483                                 bad++;
 5484                         }
 5485  
 5486                 } else {
 5487                         argv[j++] = argv[i];
 5488                         ac++;
 5489                 }
 5490         }
$input_19644 >= ( 8 * bytes_after(((char*)&$heap_69354)[32]) - 63 ) / 645491         argc = ac;
 5492  
$input_19660 >= ( 8 * bytes_after(((char*)&$heap_69378)[32]) - 63 ) / 645493         if (bad || argc != 6) {
 5494                 pvmlogerror("slave_config: bad args\n");
 5495                 pvmbailout(0);
 5496         }
 5497  
$input_19692 >= ( 8 * bytes_after(((char*)&$heap_69426)[32]) - 63 ) / 645498         mh = atoi(argv[1]);
$input_12 >= ( 8 * bytes_after(((char*)&$heap_69522)[32]) - 63 ) / 645499         lh = atoi(argv[4]);
lh >= ( 8 * bytes_after(((char*)&$heap_69618)[32]) - 63 ) / 645500         hosts = ht_new(1);
lh >= ( 8 * bytes_after(&$unknown_806839) - 63 ) / 645501         hosts->ht_serial = 1;
lh >= ( 8 * bytes_after(&$unknown_806851) - 63 ) / 645502         hosts->ht_master = mh;
lh >= ( 8 * bytes_after(&$unknown_806863) - 63 ) / 645503         hosts->ht_cons = mh;
lh >= ( 8 * bytes_after(&$unknown_806875) - 63 ) / 645504         hosts->ht_local = lh;
 5505  
hosts->ht_local >= ( 8 * bytes_after(&$unknown_806887) - 63 ) / 645506         hp = hd_new(mh);
hosts->ht_local >= ( 8 * bytes_after(&$unknown_806911) - 63 ) / 645507         hp->hd_name = STRALLOC("?");   /* Null Pointer Dereference (ID: 2673.2721) */
hosts->ht_local >= ( 8 * bytes_after(&$unknown_806967) - 63 ) / 645508         hex_inadport(argv[2], &hp->hd_sad);
hosts->ht_local >= ( 8 * bytes_after(&$unknown_806979) - 63 ) / 645509         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) */
 5524         hp->hd_arch = STRALLOC(myarchname);   /* Null Pointer Dereference (ID: 2670.2715) */
 5525         hp->hd_mtu = pvmudpmtu;
 5526         hp->hd_dsig = pvmmydsig;
 5527         hex_inadport(argv[5], &hp->hd_sad);
 5528         ht_insert(hosts, hp);
 5529         hd_unref(hp);
 5530  
hosts->ht_local >= ( 8 * bytes_after(hosts->ht_hosts) - 63 ) / 645531         if (i = mksocs()) {
     Enter slave_config / mksocs
 4834   mksocs() 
 4835   {
hosts->ht_local >= ( 8 * bytes_after(hosts->ht_hosts) - 63 ) / 644836           struct hostd *hp = hosts->ht_hosts[hosts->ht_local];     /* Buffer Overrun */  /* Buffer Underrun (ID: 2667.2712) */
     Exit slave_config / mksocs
Preconditions
$param_2 >= 3
((char*)&$heap_71746)[4] = 0
((char*)&$heap_71746)[8] >= 0
((char*)&$heap_71748)[144] >= 0
((char*)&$heap_71748)[16] >= 0
((char*)&$heap_71748)[32] = 0
((char*)&$heap_71753)[144] >= 0
Postconditions
ac' = 6
argc' = 6
argv' = $param_3
atnewline' = 1
bad' = 0
$heap_71746' = 1
bytes_after(&$heap_71746)' = 40
$heap_71746' is allocated by malloc
$heap_71746' is allocated
bytes_before(&$heap_71746)' = 0
strlen(&$heap_71746)' = 0
((char*)&$heap_71746)[16]' = $input_12
((char*)&$heap_71746)[20]' = $input_19756
((char*)&$heap_71746)[12]' = $input_12
$heap_71748' = 0
bytes_after(&$heap_71748)' = 200
$heap_71748' is allocated by malloc
$heap_71748' is freed
bytes_before(&$heap_71748)' = 0
strlen(&$heap_71748)' = 0
((char*)&$heap_71748)[136]' = &$heap_71751
((char*)&$heap_71748)[152]' = 1
((char*)&$heap_71748)[168]' = 1000
((char*)&$heap_71748)[176]' = 0
((char*)&$heap_71748)[8]' = &$heap_71752
((char*)&$heap_71748)[84]' = $input_19764
((char*)&$heap_71748)[88]' = 2
((char*)&$heap_71748)[104]' = 1
((char*)&$heap_71748)[108]' = 1
((char*)&$heap_71748)[112]' = &$heap_71749
((char*)&$heap_71748)[120]' = &$heap_71750
bytes_after(&$heap_71749)' = 184
$heap_71749' is allocated by malloc
bytes_before(&$heap_71749)' = 0
((char*)&$heap_71749)[16]' = 0
((char*)&$heap_71749)[176]' = 0
((char*)&$heap_71749)[24]' = 0
((char*)&$heap_71749)[32]' = 0
((char*)&$heap_71749)[40]' = 0
bytes_after(&$heap_71750)' = 184
$heap_71750' is allocated by malloc
bytes_before(&$heap_71750)' = 0
((char*)&$heap_71750)[176]' = 0
((char*)&$heap_71750)[32]' = 0
((char*)&$heap_71750)[40]' = 0
bytes_after(&$heap_71751)' = 184
$heap_71751' is allocated by malloc
bytes_before(&$heap_71751)' = 0
((char*)&$heap_71751)[176]' = 0
((char*)&$heap_71751)[32]' = 0
((char*)&$heap_71751)[40]' = 0
$heap_71752' = 63
bytes_after(&$heap_71752)' = 2
$heap_71752' is allocated by malloc
bytes_before(&$heap_71752)' = 0
strlen(&$heap_71752)' = 1
$heap_71753' = 0
bytes_after(&$heap_71753)' = 200
$heap_71753' is allocated by malloc
$heap_71753' is freed
bytes_before(&$heap_71753)' = 0
strlen(&$heap_71753)' = 0
((char*)&$heap_71753)[136]' = &$heap_71754
((char*)&$heap_71753)[152]' = 1
((char*)&$heap_71753)[16]' = &$heap_71759
((char*)&$heap_71753)[168]' = 1000
((char*)&$heap_71753)[176]' = &$heap_71755
((char*)&$heap_71753)[76]' = pvmmydsig
((char*)&$heap_71753)[8]' = &$heap_71758
((char*)&$heap_71753)[84]' = pvmudpmtu
((char*)&$heap_71753)[88]' = 2
((char*)&$heap_71753)[104]' = 1
((char*)&$heap_71753)[108]' = 1
((char*)&$heap_71753)[112]' = &$heap_71757
((char*)&$heap_71753)[120]' = &$heap_71756
bytes_after(&$heap_71754)' = 184
$heap_71754' is allocated by malloc
bytes_before(&$heap_71754)' = 0
((char*)&$heap_71754)[176]' = 0
((char*)&$heap_71754)[32]' = 0
((char*)&$heap_71754)[40]' = 0
bytes_after(&$heap_71755)' = 32
$heap_71755' is allocated by malloc
bytes_before(&$heap_71755)' = 0
((char*)&$heap_71755)[16]' = 0
((char*)&$heap_71755)[20]' = 0
((char*)&$heap_71755)[24]' = 0
bytes_after(&$heap_71756)' = 184
$heap_71756' is allocated by malloc
bytes_before(&$heap_71756)' = 0
((char*)&$heap_71756)[176]' = 0
((char*)&$heap_71756)[32]' = 0
((char*)&$heap_71756)[40]' = 0
bytes_after(&$heap_71757)' = 184
$heap_71757' is allocated by malloc
bytes_before(&$heap_71757)' = 0
((char*)&$heap_71757)[16]' = 0
((char*)&$heap_71757)[176]' = 0
((char*)&$heap_71757)[24]' = 0
((char*)&$heap_71757)[32]' = 0
((char*)&$heap_71757)[40]' = 0
$heap_71758' = 112
bytes_after(&$heap_71758)' = 6
$heap_71758' is allocated by malloc
bytes_before(&$heap_71758)' = 0
strlen(&$heap_71758)' = 5
$heap_71759' = *myarchname
bytes_after(&$heap_71759)' = strlen(myarchname) + 1
$heap_71759' is allocated by malloc
bytes_before(&$heap_71759)' = 0
strlen(&$heap_71759)' = strlen(myarchname)
$heap_71763' = 1
bytes_after(&$heap_71763)' = 200
$heap_71763' is allocated by malloc
bytes_before(&$heap_71763)' = 0
strlen(&$heap_71763)' = 0
((char*)&$heap_71763)[136]' = &$heap_71764
((char*)&$heap_71763)[152]' = 1
((char*)&$heap_71763)[16]' = &$heap_71769
((char*)&$heap_71763)[168]' = 1000
((char*)&$heap_71763)[176]' = &$heap_71765
((char*)&$heap_71763)[76]' = pvmmydsig
((char*)&$heap_71763)[8]' = &$heap_71768
((char*)&$heap_71763)[84]' = pvmudpmtu
((char*)&$heap_71763)[88]' = 2
((char*)&$heap_71763)[104]' = 1
((char*)&$heap_71763)[108]' = 1
((char*)&$heap_71763)[112]' = &$heap_71766
((char*)&$heap_71763)[120]' = &$heap_71767
bytes_after(&$heap_71764)' = 184
$heap_71764' is allocated by malloc
$heap_71764' is allocated
bytes_before(&$heap_71764)' = 0
((char*)&$heap_71764)[16]' = 0
((char*)&$heap_71764)[176]' = 0
((char*)&$heap_71764)[24]' = 0
((char*)&$heap_71764)[32]' = 0
((char*)&$heap_71764)[40]' = 0
$heap_71765' = &$heap_71765
bytes_after(&$heap_71765)' = 32
$heap_71765' is allocated by malloc
$heap_71765' is allocated
bytes_before(&$heap_71765)' = 0
((char*)&$heap_71765)[16]' = 0
((char*)&$heap_71765)[20]' = 0
((char*)&$heap_71765)[24]' = 0
((char*)&$heap_71765)[8]' = &$heap_71765
bytes_after(&$heap_71766)' = 184
$heap_71766' is allocated by malloc
$heap_71766' is allocated
bytes_before(&$heap_71766)' = 0
((char*)&$heap_71766)[16]' = 0
((char*)&$heap_71766)[176]' = 0
((char*)&$heap_71766)[24]' = 0
((char*)&$heap_71766)[32]' = 0
((char*)&$heap_71766)[40]' = 0
bytes_after(&$heap_71767)' = 184
$heap_71767' is allocated by malloc
$heap_71767' is allocated
bytes_before(&$heap_71767)' = 0
((char*)&$heap_71767)[16]' = 0
((char*)&$heap_71767)[176]' = 0
((char*)&$heap_71767)[24]' = 0
((char*)&$heap_71767)[32]' = 0
((char*)&$heap_71767)[40]' = 0
$heap_71768' = *$param_1
bytes_after(&$heap_71768)' = strlen($param_1) + 1
$heap_71768' is allocated by malloc
$heap_71768' is allocated
bytes_before(&$heap_71768)' = 0
strlen(&$heap_71768)' = strlen($param_1)
$heap_71769' = *myarchname
bytes_after(&$heap_71769)' = strlen(myarchname) + 1
$heap_71769' is allocated by malloc
$heap_71769' is allocated
bytes_before(&$heap_71769)' = 0
strlen(&$heap_71769)' = strlen(myarchname)
hn' = $param_1
hosts' = &$heap_71746
hp' = &$heap_71763
i' = $param_2
lh' = $input_19756
mh' = $input_12
tmbuf.tm_sec' = &$unknown_807060




Change Warning 2668.2713 : Buffer Overrun

Priority:
State:
Finding:
Owner:
Note: