Text  |   XML   |   Visible Warnings:

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

Categories: LANG.MEM.BU CWE:124 CWE:127
Warning ID: 2667.2712
Procedure: mksocs
Trace: View
Modified: Wed Sep 2 12:42:46 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_15540 <= ( -8 * bytes_before(((char*)&$heap_55467)[32]) - 1 ) / 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_15556 <= ( -8 * bytes_before(((char*)&$heap_55491)[32]) - 1 ) / 645459         int ms = 0;             /* manual (humanoid) startup */ 
 5460 #ifndef WIN32 
$input_15572 <= ( -8 * bytes_before(((char*)&$heap_55515)[32]) - 1 ) / 645461         int dof = 1;            /* fork, exit parent (default) */ 
 5462 #else 
 5463         int dof = 0; 
 5464 #endif 
$input_15588 <= ( -8 * bytes_before(((char*)&$heap_55539)[32]) - 1 ) / 645465         int bad = 0;
 5466         char *p;
 5467         char *s;
 5468  
$input_15604 <= ( -8 * bytes_before(((char*)&$heap_55563)[32]) - 1 ) / 645469         for (i = j = ac = 1; i < argc; i++) {
$input_15684 <= ( -8 * bytes_before(((char*)&$heap_55683)[32]) - 1 ) / 645470                 if (argv[i][0] == '-') {
$input_15700 <= ( -8 * bytes_before(((char*)&$heap_55707)[32]) - 1 ) / 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_15716 <= ( -8 * bytes_before(((char*)&$heap_55731)[32]) - 1 ) / 645481                         default: 
$input_15732 <= ( -8 * bytes_before(((char*)&$heap_55755)[32]) - 1 ) / 645482                                 pvmlogprintf("slave_config() unknown switch: %s\n", argv[i]);
$input_16404 <= ( -8 * bytes_before(((char*)&$heap_56763)[32]) - 1 ) / 645483                                 bad++;
 5484                         }
 5485  
 5486                 } else {
 5487                         argv[j++] = argv[i];
 5488                         ac++;
 5489                 }
 5490         }
$input_16468 <= ( -8 * bytes_before(((char*)&$heap_56859)[32]) - 1 ) / 645491         argc = ac;
 5492  
$input_16484 <= ( -8 * bytes_before(((char*)&$heap_56883)[32]) - 1 ) / 645493         if (bad || argc != 6) {
 5494                 pvmlogerror("slave_config: bad args\n");
 5495                 pvmbailout(0);
 5496         }
 5497  
$input_16516 <= ( -8 * bytes_before(((char*)&$heap_56931)[32]) - 1 ) / 645498         mh = atoi(argv[1]);
$input_12 <= ( -8 * bytes_before(((char*)&$heap_57027)[32]) - 1 ) / 645499         lh = atoi(argv[4]);
lh <= ( -8 * bytes_before(((char*)&$heap_57123)[32]) - 1 ) / 645500         hosts = ht_new(1);
lh <= ( -8 * bytes_before(&$unknown_802173) - 1 ) / 645501         hosts->ht_serial = 1;
lh <= ( -8 * bytes_before(&$unknown_802185) - 1 ) / 645502         hosts->ht_master = mh;
lh <= ( -8 * bytes_before(&$unknown_802197) - 1 ) / 645503         hosts->ht_cons = mh;
lh <= ( -8 * bytes_before(&$unknown_802209) - 1 ) / 645504         hosts->ht_local = lh;
 5505  
hosts->ht_local <= ( -8 * bytes_before(&$unknown_802221) - 1 ) / 645506         hp = hd_new(mh);
hosts->ht_local <= ( -8 * bytes_before(&$unknown_802245) - 1 ) / 645507         hp->hd_name = STRALLOC("?");   /* Null Pointer Dereference (ID: 2673.2721) */
hosts->ht_local <= ( -8 * bytes_before(&$unknown_802301) - 1 ) / 645508         hex_inadport(argv[2], &hp->hd_sad);
hosts->ht_local <= ( -8 * bytes_before(&$unknown_802313) - 1 ) / 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_before(hosts->ht_hosts) - 1 ) / 645531         if (i = mksocs()) {
     Enter slave_config / mksocs
 4834   mksocs() 
 4835   {
hosts->ht_local <= ( -8 * bytes_before(hosts->ht_hosts) - 1 ) / 644836           struct hostd *hp = hosts->ht_hosts[hosts->ht_local];     /* Buffer Underrun */  /* Buffer Overrun (ID: 2668.2713) */
     Exit slave_config / mksocs
Preconditions
$param_2 >= 3
((char*)&$heap_59251)[4] = 0
((char*)&$heap_59251)[8] >= 0
((char*)&$heap_59253)[144] >= 0
((char*)&$heap_59253)[16] >= 0
((char*)&$heap_59253)[32] = 0
((char*)&$heap_59258)[144] >= 0
Postconditions
ac' = 6
argc' = 6
argv' = $param_3
atnewline' = 1
bad' = 0
$heap_59251' = 1
bytes_after(&$heap_59251)' = 40
$heap_59251' is allocated by malloc
$heap_59251' is allocated
bytes_before(&$heap_59251)' = 0
strlen(&$heap_59251)' = 0
((char*)&$heap_59251)[16]' = $input_12
((char*)&$heap_59251)[20]' = $input_16580
((char*)&$heap_59251)[12]' = $input_12
$heap_59253' = 0
bytes_after(&$heap_59253)' = 200
$heap_59253' is allocated by malloc
$heap_59253' is freed
bytes_before(&$heap_59253)' = 0
strlen(&$heap_59253)' = 0
((char*)&$heap_59253)[136]' = &$heap_59256
((char*)&$heap_59253)[152]' = 1
((char*)&$heap_59253)[168]' = 1000
((char*)&$heap_59253)[176]' = 0
((char*)&$heap_59253)[8]' = &$heap_59257
((char*)&$heap_59253)[84]' = $input_16588
((char*)&$heap_59253)[88]' = 2
((char*)&$heap_59253)[104]' = 1
((char*)&$heap_59253)[108]' = 1
((char*)&$heap_59253)[112]' = &$heap_59254
((char*)&$heap_59253)[120]' = &$heap_59255
bytes_after(&$heap_59254)' = 184
$heap_59254' is allocated by malloc
bytes_before(&$heap_59254)' = 0
((char*)&$heap_59254)[16]' = 0
((char*)&$heap_59254)[176]' = 0
((char*)&$heap_59254)[24]' = 0
((char*)&$heap_59254)[32]' = 0
((char*)&$heap_59254)[40]' = 0
bytes_after(&$heap_59255)' = 184
$heap_59255' is allocated by malloc
bytes_before(&$heap_59255)' = 0
((char*)&$heap_59255)[176]' = 0
((char*)&$heap_59255)[32]' = 0
((char*)&$heap_59255)[40]' = 0
$heap_59256' = &$heap_59256
bytes_after(&$heap_59256)' = 184
$heap_59256' is allocated by malloc
bytes_before(&$heap_59256)' = 0
((char*)&$heap_59256)[176]' = 0
((char*)&$heap_59256)[32]' = 0
((char*)&$heap_59256)[40]' = 0
((char*)&$heap_59256)[8]' = &$heap_59256
$heap_59257' = 63
bytes_after(&$heap_59257)' = 2
$heap_59257' is allocated by malloc
bytes_before(&$heap_59257)' = 0
strlen(&$heap_59257)' = 1
$heap_59258' = 0
bytes_after(&$heap_59258)' = 200
$heap_59258' is allocated by malloc
$heap_59258' is freed
bytes_before(&$heap_59258)' = 0
strlen(&$heap_59258)' = 0
((char*)&$heap_59258)[136]' = &$heap_59259
((char*)&$heap_59258)[152]' = 1
((char*)&$heap_59258)[16]' = &$heap_59264
((char*)&$heap_59258)[168]' = 1000
((char*)&$heap_59258)[176]' = &$heap_59260
((char*)&$heap_59258)[76]' = pvmmydsig
((char*)&$heap_59258)[8]' = &$heap_59263
((char*)&$heap_59258)[84]' = pvmudpmtu
((char*)&$heap_59258)[88]' = 2
((char*)&$heap_59258)[104]' = 1
((char*)&$heap_59258)[108]' = 1
((char*)&$heap_59258)[112]' = &$heap_59262
((char*)&$heap_59258)[120]' = &$heap_59261
bytes_after(&$heap_59259)' = 184
$heap_59259' is allocated by malloc
bytes_before(&$heap_59259)' = 0
((char*)&$heap_59259)[176]' = 0
((char*)&$heap_59259)[32]' = 0
((char*)&$heap_59259)[40]' = 0
bytes_after(&$heap_59260)' = 32
$heap_59260' is allocated by malloc
bytes_before(&$heap_59260)' = 0
((char*)&$heap_59260)[16]' = 0
((char*)&$heap_59260)[20]' = 0
((char*)&$heap_59260)[24]' = 0
bytes_after(&$heap_59261)' = 184
$heap_59261' is allocated by malloc
bytes_before(&$heap_59261)' = 0
((char*)&$heap_59261)[176]' = 0
((char*)&$heap_59261)[32]' = 0
((char*)&$heap_59261)[40]' = 0
bytes_after(&$heap_59262)' = 184
$heap_59262' is allocated by malloc
bytes_before(&$heap_59262)' = 0
((char*)&$heap_59262)[16]' = 0
((char*)&$heap_59262)[176]' = 0
((char*)&$heap_59262)[24]' = 0
((char*)&$heap_59262)[32]' = 0
((char*)&$heap_59262)[40]' = 0
$heap_59263' = 112
bytes_after(&$heap_59263)' = 6
$heap_59263' is allocated by malloc
bytes_before(&$heap_59263)' = 0
strlen(&$heap_59263)' = 5
$heap_59264' = *myarchname
bytes_after(&$heap_59264)' = strlen(myarchname) + 1
$heap_59264' is allocated by malloc
bytes_before(&$heap_59264)' = 0
strlen(&$heap_59264)' = strlen(myarchname)
$heap_59268' = 1
bytes_after(&$heap_59268)' = 200
$heap_59268' is allocated by malloc
bytes_before(&$heap_59268)' = 0
strlen(&$heap_59268)' = 0
((char*)&$heap_59268)[136]' = &$heap_59269
((char*)&$heap_59268)[152]' = 1
((char*)&$heap_59268)[16]' = &$heap_59274
((char*)&$heap_59268)[168]' = 1000
((char*)&$heap_59268)[176]' = &$heap_59270
((char*)&$heap_59268)[76]' = pvmmydsig
((char*)&$heap_59268)[8]' = &$heap_59273
((char*)&$heap_59268)[84]' = pvmudpmtu
((char*)&$heap_59268)[88]' = 2
((char*)&$heap_59268)[104]' = 1
((char*)&$heap_59268)[108]' = 1
((char*)&$heap_59268)[112]' = &$heap_59271
((char*)&$heap_59268)[120]' = &$heap_59272
bytes_after(&$heap_59269)' = 184
$heap_59269' is allocated by malloc
$heap_59269' is allocated
bytes_before(&$heap_59269)' = 0
((char*)&$heap_59269)[16]' = 0
((char*)&$heap_59269)[176]' = 0
((char*)&$heap_59269)[24]' = 0
((char*)&$heap_59269)[32]' = 0
((char*)&$heap_59269)[40]' = 0
$heap_59270' = &$heap_59270
bytes_after(&$heap_59270)' = 32
$heap_59270' is allocated by malloc
$heap_59270' is allocated
bytes_before(&$heap_59270)' = 0
((char*)&$heap_59270)[16]' = 0
((char*)&$heap_59270)[20]' = 0
((char*)&$heap_59270)[24]' = 0
((char*)&$heap_59270)[8]' = &$heap_59270
bytes_after(&$heap_59271)' = 184
$heap_59271' is allocated by malloc
$heap_59271' is allocated
bytes_before(&$heap_59271)' = 0
((char*)&$heap_59271)[16]' = 0
((char*)&$heap_59271)[176]' = 0
((char*)&$heap_59271)[24]' = 0
((char*)&$heap_59271)[32]' = 0
((char*)&$heap_59271)[40]' = 0
bytes_after(&$heap_59272)' = 184
$heap_59272' is allocated by malloc
$heap_59272' is allocated
bytes_before(&$heap_59272)' = 0
((char*)&$heap_59272)[16]' = 0
((char*)&$heap_59272)[176]' = 0
((char*)&$heap_59272)[24]' = 0
((char*)&$heap_59272)[32]' = 0
((char*)&$heap_59272)[40]' = 0
$heap_59273' = *$param_1
bytes_after(&$heap_59273)' = strlen($param_1) + 1
$heap_59273' is allocated by malloc
$heap_59273' is allocated
bytes_before(&$heap_59273)' = 0
strlen(&$heap_59273)' = strlen($param_1)
$heap_59274' = *myarchname
bytes_after(&$heap_59274)' = strlen(myarchname) + 1
$heap_59274' is allocated by malloc
$heap_59274' is allocated
bytes_before(&$heap_59274)' = 0
strlen(&$heap_59274)' = strlen(myarchname)
hn' = $param_1
hosts' = &$heap_59251
hp' = &$heap_59268
i' = $param_2
lh' = $input_16580
mh' = $input_12
tmbuf.tm_sec' = &$unknown_802394




Change Warning 2667.2712 : Buffer Underrun

Priority:
State:
Finding:
Owner:
Note: