Text  |   XML   |   Visible Warnings:

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

Categories: ALLOC.IOAS BSI:MALLOC-OVERFLOW CWE:680
Warning ID: 561.29250
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                         {
   ...
 1743  
 1744                         for ( i=0 ; i < num ; i++ )
 1745                         {
 1746                                 TRC_ARR_VALUE_OF( tmp, float, i ) = 
 1747                                         TRC_ARR_VALUE_OF( V, float, i );
 1748                         }
 1749  
 1750                         break;
 1751                 }
 1752  
 1753                 case TEV_DATA_INT: 
 1754                 case TEV_DATA_UINT: 
 1755                 {
true1756                         tmp = (TRC_VALUE) malloc( (unsigned) num * sizeof( int ) );     /* Integer Overflow of Allocation Size */
Preconditions
V != 0
dt = 6
num >= 1
$input_12 = 0
Postconditions
tmp' = 0




Change Warning 561.29250 : Integer Overflow of Allocation Size

Priority:
State:
Finding:
Owner:
Note: