Text  |   XML   |   Visible Warnings:

Pvm : Pvm analysis 1 : Uninitialized Variable  at trcutil.c:3037

Categories: LANG.MEM.UVAR CWE:457
Warning ID: 2853.2916
Procedure: trc_copy_str
Trace: View
Modified: Wed Sep 2 12:50:29 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
   /u1/paul/SATE/2010/c/pvm/pvm3/tracer/trcfile.c
   Enter trc_unpack_data_value
true1495 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: 2854.2917) */  /* Leak (ID: 2852.2915) */
 1513  
 1514         DD->num = num;
 1515  
 1516         switch ( DD->dt ) 
 1517         {
 1518                 case TEV_DATA_NULLbreak;
 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 
 1614                                         * sizeof(char *) );
 1615                         trc_memcheck( DD->data, "String Array" );
 1616  
 1617                         for ( i=0 ; i < num ; i++ )
 1618                         {
 1619                                 TRC_PVMCKERR( pvm_upkstr( upk_str ),
 1620                                         "Event STRING Unpack", return( TRC_FALSE ) );
 1621  
upk_str is uninitialized1622                                 ((char **) DD->data)[i] = trc_copy_str( upk_str );
     /u1/paul/SATE/2010/c/pvm/pvm3/tracer/trcutil.c
     Enter trc_unpack_data_value / trc_copy_str
 3031   char * 
*$param_1 is uninitialized3032   trc_copy_str( str ) 
 3033   char *str;
 3034   {
 3035           char *tmp;
 3036    
*str is uninitialized3037           tmp = (char *) malloc( (unsigned) (strlen(str) + 1)     /* Uninitialized Variable */  /* Uninitialized Variable (ID: 2862.2927) */
     Exit trc_unpack_data_value / trc_copy_str
Preconditions
&$unknown_2787194 >= 1
&$unknown_2787228 != 0
((char*)$param_1)[8] = 12
((char*)$param_1)[12] = 128
myfmt = -1
nxtmidhsiz <= pvmmidhsiz
pvmautoerr != 0
pvmautoerr != 2
pvmautoerr != 3
pvmmidhfree = 0
pvmmidhsiz != 0
pvmmytid = -1
pvmrbuf != 0
pvmtoplvl != 0
pvmtrc.trctid >= 1
Postconditions
DD' = $param_1
TRC_TMP_CC' = 0
bytes_after(&$heap_217410)' = 8 * &$unknown_2787194
$heap_217410' is allocated by malloc
$heap_217410' is allocated
bytes_before(&$heap_217410)' = 0
i' = 0
num' = &$unknown_2787194
pvmmytid' != -1
pvmrbuf' = &$unknown_2787228
pvmtrc.trctid' <= 0
str' = &upk_str[0]
topvmd' = 0




Change Warning 2853.2916 : Uninitialized Variable

Priority:
State:
Finding:
Owner:
Note: