Text  |   XML   |   Visible Warnings:

pvm3.4.6 : pvm3.4.6 analysis 2 : Uninitialized Variable  at trcfile.c:167

Categories: LANG.MEM.UVAR CWE:457
Warning ID: 434.29183
Procedure: trc_add_tevdesc
Trace: view
Modified: Thu Nov 26 11:35:40 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_add_tevdesc
 114 trc_add_tevdesc( ID, TDptr, tid, omit ) 
 115 TRC_ID ID;
 116 TRC_TEVDESC *TDptr;
 117 int tid;
 118 int omit;
 119 {
 120         TRC_TEVDESC *newlist;
 121  
 122         TRC_TEVDESC tdptr;
 123         TRC_TEVDESC last;
 124  
 125         int newsize;
 126         int index;
 127         int eid;
 128         int i;
 129  
 130         /* Verify Descriptor List is Large Enough */ 
 131  
 132         eid = (*TDptr)->eid;
 133  
 134         if ( eid >= TRC_TEVDESC_SIZE )
 135         {
 136                 newsize = 2 * ( eid + 1 );
 137  
 138                 newlist = (TRC_TEVDESC *) malloc( (unsigned) newsize 
true139                         * sizeof( TRC_TEVDESC ) );   /* Integer Overflow of Allocation Size (ID: 435.29184) */
 140                 trc_memcheck( newlist, "New TRC_TEVDESC Pointer List" );
 141  
 142                 for ( i=0 ; i < TRC_TEVDESC_SIZE ; i++ )
 143                 {
 144                         newlist[i] = TRC_TEVDESC_LIST[i];
 145  
 146                         TRC_TEVDESC_LIST[i] = (TRC_TEVDESC) NULL;
 147                 }
 148  
 149                 i = ( TRC_TEVDESC_SIZE >= 0 ) ? TRC_TEVDESC_SIZE : 0;   /* Useless Assignment (ID: 433.29182) */
 150  
 151                 while ( i < newsize )
 152                 {
 153                         newlist[i] = (TRC_TEVDESC) NULL;
 154  
 155                         i++;
 156                 }
 157  
 158                 free( TRC_TEVDESC_LIST );
 159  
*newlist is uninitialized160                 TRC_TEVDESC_LIST = newlist;
 161  
 162                 TRC_TEVDESC_SIZE = newsize;
 163         }
 164  
 165         /* Search for Existing Descriptor */ 
 166  
*TRC_TEVDESC_LIST is uninitialized167         tdptr = TRC_TEVDESC_LIST[ eid ];     /* Uninitialized Variable */
Preconditions
(*TDptr)->eid = -1
TRC_TEVDESC_SIZE <= -1
Postconditions
*TRC_TEVDESC_LIST' is freed
TRC_TEVDESC_LIST' = &$heap_410737
TRC_TEVDESC_SIZE' = 2 * (*TDptr)->eid + 2
eid' = (*TDptr)->eid
bytes_after(&$heap_410737)' = 8 * (*TDptr)->eid + 8
$heap_410737' is allocated by malloc
$heap_410737' is allocated
bytes_before(&$heap_410737)' = 0
i' = 0
newlist' = &$heap_410737
newsize' = 2 * (*TDptr)->eid + 2




Change Warning 434.29183 : Uninitialized Variable

Priority:
State:
Finding:
Owner:
Note: