Text  |   XML   |   Visible Warnings:

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

Categories: ALLOC.IOAS BSI:MALLOC-OVERFLOW CWE:680
Warning ID: 564.29246
Procedure: trc_copy_value
Trace: view
Modified: Thu Nov 26 11:36:25 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                         {
 1699                                 TRC_ARR_VALUE_OF( tmp, char, i ) = 
 1700                                         TRC_ARR_VALUE_OF( V, char, i );
 1701                         }
 1702  
 1703                         break;
 1704                 }
 1705  
 1706                 case TEV_DATA_STRING: 
 1707                 {
 1708                         tmp = (TRC_VALUE) malloc( (unsigned) num 
true1709                                 * sizeof( char * ) );     /* Integer Overflow of Allocation Size */
Preconditions
V != 0
dt = 12
num >= 1
$input_12 = 0
Postconditions
tmp' = 0




Change Warning 564.29246 : Integer Overflow of Allocation Size

Priority:
State:
Finding:
Owner:
Note: