Text  |   XML   |   Visible Warnings:

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

Categories: ALLOC.IOAS BSI:MALLOC-OVERFLOW CWE:680
Warning ID: 424.29178
Procedure: trc_make_value
Trace: view
Modified: Thu Nov 26 11:35:39 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_make_value
 1574 trc_make_value( dt, num ) 
 1575 int dt;
 1576 int num;
 1577 {
 1578         TRC_VALUE tmp;
 1579  
 1580         int i;
 1581  
 1582         if ( num < 1 )
 1583                 return( (TRC_VALUE) NULL );
 1584  
 1585         tmp = (TRC_VALUE) NULL;
 1586  
 1587         switch ( dt ) 
 1588         {
 1589                 case TEV_DATA_NULL: break;
 1590  
 1591                 case TEV_DATA_BYTE: 
 1592                 {
 1593                         tmp = (TRC_VALUE) malloc( (unsigned) num * sizeof( char ) );
 1594                         trc_memcheck( tmp, "Character Data Pointer" );
 1595  
 1596                         break;
 1597                 }
   ...
 1627  
 1628                 case TEV_DATA_INT: 
 1629                 case TEV_DATA_UINT: 
 1630                 {
 1631                         tmp = (TRC_VALUE) malloc( (unsigned) num * sizeof( int ) );   /* Integer Overflow of Allocation Size (ID: 426.29175) */
 1632                         trc_memcheck( tmp, "Integer Data Pointer" );
 1633  
 1634                         break;
 1635                 }
 1636  
 1637                 case TEV_DATA_LONG: 
 1638                 case TEV_DATA_ULONG: 
 1639                 {
true1640                         tmp = (TRC_VALUE) malloc( (unsigned) num * sizeof( long ) );     /* Integer Overflow of Allocation Size */
Preconditions
dt = 8
num >= 1
$input_12 = 0
Postconditions
tmp' = 0




Change Warning 424.29178 : Integer Overflow of Allocation Size

Priority:
State:
Finding:
Owner:
Note: