Text  |   XML   |   Visible Warnings:

pvm3.4.6 : pvm3.4.6 analysis 2 : Integer Overflow of Allocation Size  at pvmgsu_core.c:855

Categories: ALLOC.IOAS BSI:MALLOC-OVERFLOW CWE:680
Warning ID: 22179.29322
Procedure: gs_cachegroup
Trace: view
Modified: Thu Nov 26 11:37:17 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/pvmgs/pvmgsu_core.c
   Enter gs_cachegroup
 792 gs_cachegroup(sgroup_list, ngroups, rsgroup) 
 793 GROUP_LIST_PTR sgroup_list;
 794 int *ngroups;
 795 GROUP_STRUCT_PTR *rsgroup;
 796 {
 797         char *newname = (char *) NULL;  
 798  
 799         int info;
 800         int len;
 801  
 802         GROUP_STRUCT_PTR sgroup;  
 803  
 804         *rsgroup = (GROUP_STRUCT_PTR) NULL;
 805  
 806         if ( (info = pvm_upkint(&len,1,1))  < 0 )
 807                 DO_ERROR_RTN( info, "gs_cachegroup" );
 808  
 809         if (len < 0)                  /* didn't get a valid groupname     */   /* Uninitialized Variable (ID: 534.29325) */
 810                 return(-1);
 811  
 812         if ( (newname = (char *) PVM_ALLOC(sizeof(char)*(len + 1),
 813                         "gs_cachegroup") ) == (char *) NULL)  
 814                 DO_ERROR_RTN( PvmNoMem, "gs_cachegroup" );
 815  
 816         if ( (info = pvm_upkstr(newname))  < 0  )
 817         {
 818                 PVM_FREE(newname);
 819                 DO_ERROR_RTN( info, "gs_cachegroup" );
 820         }
 821  
 822         sgroup = gs_group(newname, sgroup_list, ngroups, CREATE);
 823  
 824         if (sgroup != (GROUP_STRUCT_PTR) NULL)
 825         {
 826                 if ( (info = pvm_upkint(&(sgroup->ntids),1,1) ) < 0 )
 827                 {
 828                         PVM_FREE(newname);
 829                         DO_ERROR_RTN( info, "gs_cachegroup" );
 830                 }
 831  
 832                 if ( (info = pvm_upkint(&(sgroup->maxntids),1,1) ) < 0 )
 833                 {
 834                         PVM_FREE(newname);
 835                         DO_ERROR_RTN( info, "gs_cachegroup" );
 836                 }
 837  
 838                 sgroup->tids = (int *) PVM_ALLOC(sgroup->maxntids*sizeof(int),
 839                                 "gs_cachegroup");   /* Integer Overflow of Allocation Size (ID: 530.29323) */
 840  
 841                 if (sgroup->tids == (int *) NULL)
 842                         gs_delete_group(newname, sgroup_list, ngroups);
 843                 else 
 844                 {
 845                         if ( (info = pvm_upkint(sgroup->tids,sgroup->maxntids,1) ) < 0)
 846                         {
 847                                 gs_delete_group(newname, sgroup_list, ngroups);
 848                                 PVM_FREE(newname);
 849                                 DO_ERROR_RTN( info, "gs_cachegroup" );
 850                         }
 851  
 852                         info = pvm_upkint(&(sgroup->nhosts),1,1);
 853  
 854                         sgroup->np_onhost = (int *) PVM_ALLOC(sizeof(int) *  
true855                                         sgroup->nhosts,"gs_cachegroup");     /* Integer Overflow of Allocation Size */
Preconditions
pvmrbuf != 0
pvmtoplvl != 0
pvmtrc.trctid != pvmmytid
pvmtrc.trctid >= 1
$input_12 = 0
Postconditions
((char*)&$unknown_12361022)[16]' >= 0
((char*)&$unknown_12361022)[12]' = &$heap_450729
$heap_450728' is allocated by malloc
$heap_450728' is allocated
bytes_before(&$heap_450728)' = 0
$heap_450729' is allocated by malloc
bytes_before(&$heap_450729)' = 0
len' >= 0
newname' = &$heap_450728
sgroup' = &$unknown_12361022




Change Warning 22179.29322 : Integer Overflow of Allocation Size

Priority:
State:
Finding:
Owner:
Note: