Text  |   XML   |   Visible Warnings:

pvm3.4.6 : pvm3.4.6 analysis 2 : Integer Overflow of Allocation Size  at trcutil.c:1771

Categories: ALLOC.IOAS BSI:MALLOC-OVERFLOW CWE:680
Warning ID: 566.29248
Procedure: trc_copy_value
Trace: view
Modified: Thu Nov 26 11:36: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/tracer/trcutil.c
   Enter trc_copy_value
 1674 trc_copy_value( V, dt, num ) 
 1675 TRC_VALUE V;
 1676 int dt;
 1677 int num;
 1678 {
 1679         TRC_VALUE tmp;
 1680  
 1681         int i;
 1682  
 1683         if ( V == NULL || num < 1 )
 1684                 return( (TRC_VALUE) NULL );
 1685  
 1686         tmp = (TRC_VALUE) NULL;
 1687  
 1688         switch ( dt ) 
 1689         {
 1690                 case TEV_DATA_NULL: break;
 1691  
 1692                 case TEV_DATA_BYTE: 
 1693                 {
 1694                         tmp = (TRC_VALUE) malloc( (unsigned) num * sizeof( char ) );
 1695                         trc_memcheck( tmp, "Character Data Pointer" );
 1696  
 1697                         for ( i=0 ; i < num ; i++ )
 1698                         {
   ...
 1758  
 1759                         for ( i=0 ; i < num ; i++ )
 1760                         {
 1761                                 TRC_ARR_VALUE_OF( tmp, int, i ) = 
 1762                                         TRC_ARR_VALUE_OF( V, int, i );
 1763                         }
 1764  
 1765                         break;
 1766                 }
 1767  
 1768                 case TEV_DATA_LONG: 
 1769                 case TEV_DATA_ULONG: 
 1770                 {
true1771                         tmp = (TRC_VALUE) malloc( (unsigned) num * sizeof( long ) );     /* Integer Overflow of Allocation Size */
Preconditions
V != 0
dt = 9
num >= 1
$input_12 = 0
Postconditions
tmp' = 0




Change Warning 566.29248 : Integer Overflow of Allocation Size

Priority:
State:
Finding:
Owner:
Note: