Text  |   XML   |   Visible Warnings:

pvm3.4.6 : pvm3.4.6 analysis 2 : Buffer Underrun  at pvmd.c:4836

Categories: LANG.MEM.BU CWE:124 CWE:127
Warning ID: 22076.28905
Procedure: mksocs
Trace: view
Modified: Thu Nov 26 11:28:27 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
   /kat0/fletcher/SATE/2010/pvm3/src/pvmd.c
   Enter slave_config
$input_91988 <= ( -8 * bytes_before(((char*)&$heap_145377)[28]) - 1 ) / 325449 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_92004 <= ( -8 * bytes_before(((char*)&$heap_145397)[28]) - 1 ) / 325459         int ms = 0;             /* manual (humanoid) startup */ 
 5460 #ifndef WIN32 
$input_92020 <= ( -8 * bytes_before(((char*)&$heap_145417)[28]) - 1 ) / 325461         int dof = 1;            /* fork, exit parent (default) */ 
 5462 #else 
 5463         int dof = 0; 
 5464 #endif 
$input_92036 <= ( -8 * bytes_before(((char*)&$heap_145437)[28]) - 1 ) / 325465         int bad = 0;
 5466         char *p;
 5467         char *s;
 5468  
$input_92052 <= ( -8 * bytes_before(((char*)&$heap_145457)[28]) - 1 ) / 325469         for (i = j = ac = 1; i < argc; i++) {
$input_92132 <= ( -8 * bytes_before(((char*)&$heap_145557)[28]) - 1 ) / 325470                 if (argv[i][0] == '-') {
$input_92148 <= ( -8 * bytes_before(((char*)&$heap_145577)[28]) - 1 ) / 325471                         switch (argv[i][1]) {
 5472  
 5473                         case 'S': 
 5474                                 ms = 1;
 5475                                 break;
 5476  
 5477                         case 'f': 
 5478                                 dof = 0;
 5479                                 break;
 5480  
$input_92164 <= ( -8 * bytes_before(((char*)&$heap_145597)[28]) - 1 ) / 325481                         default: 
$input_92180 <= ( -8 * bytes_before(((char*)&$heap_145617)[28]) - 1 ) / 325482                                 pvmlogprintf("slave_config() unknown switch: %s\n", argv[i]);
$input_92860 <= ( -8 * bytes_before(((char*)&$heap_146457)[28]) - 1 ) / 325483                                 bad++;
 5484                         }
 5485  
 5486                 } else {
 5487                         argv[j++] = argv[i];
 5488                         ac++;
 5489                 }
 5490         }
$input_92924 <= ( -8 * bytes_before(((char*)&$heap_146537)[28]) - 1 ) / 325491         argc = ac;
 5492  
$input_92940 <= ( -8 * bytes_before(((char*)&$heap_146557)[28]) - 1 ) / 325493         if (bad || argc != 6) {
 5494                 pvmlogerror("slave_config: bad args\n");
 5495                 pvmbailout(0);
 5496         }
 5497  
$input_92972 <= ( -8 * bytes_before(((char*)&$heap_146597)[28]) - 1 ) / 325498         mh = atoi(argv[1]);
$input_12 <= ( -8 * bytes_before(((char*)&$heap_146677)[28]) - 1 ) / 325499         lh = atoi(argv[4]);
lh <= ( -8 * bytes_before(((char*)&$heap_146757)[28]) - 1 ) / 325500         hosts = ht_new(1);
lh <= ( -8 * bytes_before(&$unknown_730652) - 1 ) / 325501         hosts->ht_serial = 1;
lh <= ( -8 * bytes_before(&$unknown_730654) - 1 ) / 325502         hosts->ht_master = mh;
lh <= ( -8 * bytes_before(&$unknown_730656) - 1 ) / 325503         hosts->ht_cons = mh;
lh <= ( -8 * bytes_before(&$unknown_730658) - 1 ) / 325504         hosts->ht_local = lh;
 5505  
hosts->ht_local <= ( -8 * bytes_before(&$unknown_730660) - 1 ) / 325506         hp = hd_new(mh);
 5507         hp->hd_name = STRALLOC("?");   /* Null Pointer Dereference (ID: 262.28915) */
 5508         hex_inadport(argv[2], &hp->hd_sad);
hosts->ht_local <= ( -8 * bytes_before(&$unknown_730702) - 1 ) / 325509         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: 261.28913) */
 5515         hp->hd_arch = STRALLOC(myarchname);   /* Null Pointer Dereference (ID: 260.28911) */
 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: 259.28909) */
 5524         hp->hd_arch = STRALLOC(myarchname);   /* Null Pointer Dereference (ID: 260.28908) */
 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 ) / 325531         if (i = mksocs()) {
     Enter slave_config / mksocs
 4834   mksocs() 
 4835   {
hosts->ht_local <= ( -8 * bytes_before(hosts->ht_hosts) - 1 ) / 324836           struct hostd *hp = hosts->ht_hosts[hosts->ht_local];     /* Buffer Underrun */  /* Buffer Overrun (ID: 22077.28906) */
     Exit slave_config / mksocs
Preconditions
$param_2 >= 3
((char*)*$param_3)[20] != 58
((char*)&$heap_148024)[96] >= 0
((char*)&$heap_148024)[12] >= 0
Postconditions
ac' = 6
argc' = 6
atnewline' = 1
bad' = 0
$heap_148019' = 1
bytes_after(&$heap_148019)' = 32
$heap_148019' is allocated by malloc
$heap_148019' is allocated
bytes_before(&$heap_148019)' = 0
((char*)&$heap_148019)[16]' = $input_12
((char*)&$heap_148019)[20]' = $input_93036
((char*)&$heap_148019)[12]' = $input_12
bytes_after(&$heap_148021)' = 120
$heap_148021' is allocated by malloc
bytes_before(&$heap_148021)' = 0
((char*)&$heap_148021)[16]' = 0
((char*)&$heap_148021)[20]' = 0
((char*)&$heap_148021)[116]' = 0
bytes_after(&$heap_148022)' = 120
$heap_148022' is allocated by malloc
bytes_before(&$heap_148022)' = 0
((char*)&$heap_148022)[8]' = 0
((char*)&$heap_148022)[116]' = 0
bytes_after(&$heap_148023)' = 20
$heap_148023' is allocated by malloc
bytes_before(&$heap_148023)' = 0
((char*)&$heap_148023)[16]' = 0
((char*)&$heap_148023)[8]' = 0
((char*)&$heap_148023)[12]' = 0
$heap_148024' = 0
bytes_after(&$heap_148024)' = 124
$heap_148024' is allocated by malloc
$heap_148024' is freed
bytes_before(&$heap_148024)' = 0
((char*)&$heap_148024)[52]' = $input_93044
((char*)&$heap_148024)[56]' = 2
((char*)&$heap_148024)[72]' = 1
((char*)&$heap_148024)[76]' = 1
((char*)&$heap_148024)[80]' = &$heap_148022
((char*)&$heap_148024)[8]' = &$heap_148026
((char*)&$heap_148024)[84]' = &$heap_148025
((char*)&$heap_148024)[92]' = &$heap_148021
((char*)&$heap_148024)[100]' = 1
((char*)&$heap_148024)[108]' = 1000
((char*)&$heap_148024)[112]' = &$heap_148023
bytes_after(&$heap_148025)' = 120
$heap_148025' is allocated by malloc
bytes_before(&$heap_148025)' = 0
((char*)&$heap_148025)[16]' = 0
$heap_148026' = 63
bytes_after(&$heap_148026)' = 2
$heap_148026' is allocated by malloc
bytes_before(&$heap_148026)' = 0
strlen(&$heap_148026)' = 1
tocttou($heap_148026)' = tocttou(#string176)
$heap_148027' = &$heap_148027
bytes_after(&$heap_148027)' = 120
$heap_148027' is allocated by malloc
$heap_148027' is allocated
bytes_before(&$heap_148027)' = 0
((char*)&$heap_148027)[16]' = 0
((char*)&$heap_148027)[20]' = 0
((char*)&$heap_148027)[4]' = &$heap_148027
((char*)&$heap_148027)[8]' = 0
((char*)&$heap_148027)[116]' = 0
((char*)&$heap_148027)[12]' = 0
$heap_148028' = 1
bytes_after(&$heap_148028)' = 124
$heap_148028' is allocated by malloc
bytes_before(&$heap_148028)' = 0
((char*)&$heap_148028)[44]' = pvmmydsig
((char*)&$heap_148028)[52]' = pvmudpmtu
((char*)&$heap_148028)[56]' = 2
((char*)&$heap_148028)[72]' = 1
((char*)&$heap_148028)[76]' = 1
((char*)&$heap_148028)[80]' = &$heap_148027
((char*)&$heap_148028)[8]' = &$heap_148031
((char*)&$heap_148028)[84]' = &$heap_148029
((char*)&$heap_148028)[92]' = &$heap_148030
((char*)&$heap_148028)[100]' = 1
((char*)&$heap_148028)[108]' = 1000
((char*)&$heap_148028)[112]' = 0
((char*)&$heap_148028)[12]' = &$heap_148032
$heap_148029' = &$heap_148029
bytes_after(&$heap_148029)' = 120
$heap_148029' is allocated by malloc
$heap_148029' is allocated
bytes_before(&$heap_148029)' = 0
((char*)&$heap_148029)[16]' = 0
((char*)&$heap_148029)[20]' = 0
((char*)&$heap_148029)[4]' = &$heap_148029
((char*)&$heap_148029)[8]' = 0
((char*)&$heap_148029)[116]' = 0
((char*)&$heap_148029)[12]' = 0
bytes_after(&$heap_148030)' = 120
$heap_148030' is allocated by malloc
$heap_148030' is allocated
bytes_before(&$heap_148030)' = 0
((char*)&$heap_148030)[16]' = 0
((char*)&$heap_148030)[20]' = 0
((char*)&$heap_148030)[8]' = 0
((char*)&$heap_148030)[116]' = 0
((char*)&$heap_148030)[12]' = 0
$heap_148031' = 112
bytes_after(&$heap_148031)' = 6
$heap_148031' is allocated by malloc
$heap_148031' is allocated
bytes_before(&$heap_148031)' = 0
strlen(&$heap_148031)' = 5
tocttou($heap_148031)' = tocttou(#string167)
$heap_148032' = *myarchname
bytes_after(&$heap_148032)' = strlen(myarchname) + 1
$heap_148032' is allocated by malloc
$heap_148032' is allocated
bytes_before(&$heap_148032)' = 0
strlen(&$heap_148032)' = strlen(myarchname)
tocttou($heap_148032)' = tocttou(*myarchname)
$heap_148033' = &$heap_148033
bytes_after(&$heap_148033)' = 120
$heap_148033' is allocated by malloc
$heap_148033' is allocated
bytes_before(&$heap_148033)' = 0
((char*)&$heap_148033)[16]' = 0
((char*)&$heap_148033)[20]' = 0
((char*)&$heap_148033)[4]' = &$heap_148033
((char*)&$heap_148033)[8]' = 0
((char*)&$heap_148033)[116]' = 0
((char*)&$heap_148033)[12]' = 0
bytes_after(&$heap_148034)' = 120
$heap_148034' is allocated by malloc
$heap_148034' is allocated
bytes_before(&$heap_148034)' = 0
((char*)&$heap_148034)[16]' = 0
((char*)&$heap_148034)[20]' = 0
((char*)&$heap_148034)[8]' = 0
((char*)&$heap_148034)[116]' = 0
((char*)&$heap_148034)[12]' = 0
$heap_148035' = 1
bytes_after(&$heap_148035)' = 124
$heap_148035' is allocated by malloc
bytes_before(&$heap_148035)' = 0
((char*)&$heap_148035)[44]' = pvmmydsig
((char*)&$heap_148035)[52]' = pvmudpmtu
((char*)&$heap_148035)[56]' = 2
((char*)&$heap_148035)[72]' = 1
((char*)&$heap_148035)[76]' = 1
((char*)&$heap_148035)[80]' = &$heap_148033
((char*)&$heap_148035)[8]' = &$heap_148037
((char*)&$heap_148035)[84]' = &$heap_148036
((char*)&$heap_148035)[92]' = &$heap_148034
((char*)&$heap_148035)[100]' = 1
((char*)&$heap_148035)[108]' = 1000
((char*)&$heap_148035)[112]' = 0
((char*)&$heap_148035)[12]' = &$heap_148038
bytes_after(&$heap_148036)' = 120
$heap_148036' is allocated by malloc
$heap_148036' is allocated
bytes_before(&$heap_148036)' = 0
((char*)&$heap_148036)[16]' = 0
((char*)&$heap_148036)[20]' = 0
((char*)&$heap_148036)[8]' = 0
((char*)&$heap_148036)[116]' = 0
((char*)&$heap_148036)[12]' = 0
$heap_148037' = *hn
bytes_after(&$heap_148037)' = strlen(hn) + 1
$heap_148037' is allocated by malloc
$heap_148037' is allocated
bytes_before(&$heap_148037)' = 0
strlen(&$heap_148037)' = strlen(hn)
tocttou($heap_148037)' = tocttou(*hn)
$heap_148038' = *myarchname
bytes_after(&$heap_148038)' = strlen(myarchname) + 1
$heap_148038' is allocated by malloc
$heap_148038' is allocated
bytes_before(&$heap_148038)' = 0
strlen(&$heap_148038)' = strlen(myarchname)
tocttou($heap_148038)' = tocttou(*myarchname)
hosts' = &$heap_148019
hp' = &$heap_148035
i' = argc
lh' = $input_93036
mh' = $input_12
tmbuf.tm_sec' = &$unknown_730713




Change Warning 22076.28905 : Buffer Underrun

Priority:
State:
Finding:
Owner:
Note: