Text  |   XML   |   Visible Warnings:

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

Categories: ALLOC.IOAS BSI:MALLOC-OVERFLOW CWE:680
Warning ID: 562.29247
Procedure: trc_copy_value
Trace: view
Modified: Thu Nov 26 11:36:26 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                         {
   ...
 1773  
 1774                         for ( i=0 ; i < num ; i++ )
 1775                         {
 1776                                 TRC_ARR_VALUE_OF( tmp, long, i ) = 
 1777                                         TRC_ARR_VALUE_OF( V, long, i );
 1778                         }
 1779  
 1780                         break;
 1781                 }
 1782  
 1783                 case TEV_DATA_SHORT: 
 1784                 case TEV_DATA_USHORT: 
 1785                 {
 1786                         tmp = (TRC_VALUE) malloc( (unsigned) num 
true1787                                 * sizeof( short ) );     /* Integer Overflow of Allocation Size */
Preconditions
V != 0
dt = 11
num >= 1
$input_12 = 0
Postconditions
tmp' = 0




Change Warning 562.29247 : Integer Overflow of Allocation Size

Priority:
State:
Finding:
Owner:
Note: