Text  |   XML   |   Visible Warnings:

pvm3.4.6 : pvm3.4.6 analysis 2 : Integer Overflow of Allocation Size  at trcfile.c:1614

Categories: ALLOC.IOAS BSI:MALLOC-OVERFLOW CWE:680
Warning ID: 431.29180
Procedure: trc_unpack_data_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/trcfile.c
   Enter trc_unpack_data_value
 1495 trc_unpack_data_value( DD ) 
 1496 TRC_DATADESC DD;
 1497 {
 1498         char upk_str[TRC_MAX_UNPACK_ARR_SIZE];
 1499  
 1500         int num;
 1501         int i;
 1502  
 1503         if ( DD->array == TEV_DATA_ARRAY )
 1504         {
 1505                 TRC_PVMCKERR( pvm_upkint( &num, 1, 1 ),
 1506                         "Array Unpack", return( TRC_FALSE ) );
 1507         }
 1508  
 1509         else 
 1510                 num = 1;
 1511  
 1512         DD->data = trc_make_value( DD->dt, num );   /* Uninitialized Variable (ID: 432.29181) */
 1513  
 1514         DD->num = num;
 1515  
 1516         switch ( DD->dt ) 
 1517         {
 1518                 case TEV_DATA_NULL: break;
 1519  
 1520                 case TEV_DATA_BYTE: 
 1521                 {
 1522                         TRC_PVMCKERR( pvm_upkbyte( DD->data, num, 1 ),
 1523                                 "Event BYTE Unpack", return( TRC_FALSE ) );
 1524  
 1525                         break;
 1526                 }
   ...
 1598                 }
 1599  
 1600                 case TEV_DATA_USHORT: 
 1601                 {
 1602                         TRC_PVMCKERR( pvm_upkshort( DD->data, num, 1 ),
 1603                                 "Event USHORT Unpack", return( TRC_FALSE ) );
 1604  
 1605                         break;
 1606                 }
 1607  
 1608                 case TEV_DATA_STRING: 
 1609                 {
 1610                         if ( num < 1 )
 1611                                 break;
 1612  
 1613                         DD->data = (TRC_VALUE) malloc( (unsigned) num 
true1614                                         * sizeof(char *) );     /* Integer Overflow of Allocation Size */
Preconditions
&$unknown_11710907 >= 1
DD->dt = 12
DD->array = 128
$input_12 = 0
Postconditions
TRC_TMP_CC' >= 0
num' = &$unknown_11710907




Change Warning 431.29180 : Integer Overflow of Allocation Size

Priority:
State:
Finding:
Owner:
Note: