Text  |   XML   |   Visible Warnings:

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

Categories: ALLOC.IOAS BSI:MALLOC-OVERFLOW CWE:680
Warning ID: 426.29175
Procedure: trc_make_value
Trace: view
Modified: Thu Nov 26 11:35:38 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                 }
   ...
 1618                 case TEV_DATA_CPLX: 
 1619                 case TEV_DATA_FLOAT: 
 1620                 {
 1621                         tmp = (TRC_VALUE) malloc( (unsigned) num 
 1622                                 * sizeof( float ) );   /* Integer Overflow of Allocation Size (ID: 425.29174) */
 1623                         trc_memcheck( tmp, "Float Data Pointer" );
 1624  
 1625                         break;
 1626                 }
 1627  
 1628                 case TEV_DATA_INT: 
 1629                 case TEV_DATA_UINT: 
 1630                 {
true1631                         tmp = (TRC_VALUE) malloc( (unsigned) num * sizeof( int ) );     /* Integer Overflow of Allocation Size */
Preconditions
dt = 6
num >= 1
$input_12 = 0
Postconditions
tmp' = 0




Change Warning 426.29175 : Integer Overflow of Allocation Size

Priority:
State:
Finding:
Owner:
Note: