Text  |   XML   |   Visible Warnings:

pvm3.4.6 : pvm3.4.6 analysis 2 : Uninitialized Variable  at trcutil.c:3037

Categories: LANG.MEM.UVAR CWE:457
Warning ID: 22165.29194
Procedure: trc_copy_str
Trace: view
Modified: Thu Nov 26 11:35:45 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/trcmess.c
   Enter trc_handle_trace_message
true377 trc_handle_trace_message( ID, src ) 
 378 TRC_ID ID;
 379 int src;
 380 {
 381         TRC_DATADESC DD;
 382  
 383         TRC_TEVDESC TD;
 384  
 385         TRC_TEVTASK TT;
 386  
 387         TRC_HOST H;
   ...
 404         int tusec;
 405         int tsec;
 406         int ecnt;
 407         int eid;
 408         int tid;
 409         int dt;
 410  
 411         int marker;
 412         int nest;
 413  
 414         ecnt = 0;
 415  
 416         TRC_PVMCKERR( pvm_upkint( &marker, 1, 1 ),
 417                 "Unpacking Trace Message", return( ecnt ) );
 418  
 419         /* Old PVM 3.3 Trace Format */ 
 420  
 421         if ( marker > 0 )   /* Uninitialized Variable (ID: 22167.29198) */
 422         {
 423                 tsec = marker;
 424  
 425                 TRC_PVMCKERR( pvm_upkint( &tusec, 1, 1 ),
 426                         "Event Parse Error", return( ecnt ) );
 427  
 428                 TRC_PVMCKERR( pvm_upkint( &tid, 1, 1 ),
 429                         "Event Parse Error", return( ecnt ) );
 430  
 431                 TRC_PVMCKERR( pvm_upkint( &eid, 1, 1 ),
   ...
 433  
 434                 ecnt += trc_store_old_trace_event( ID, tsec, tusec, tid, eid );   /* Uninitialized Variable (ID: 22166.29197) */
 435  
 436                 return( ecnt );
 437         }
 438  
 439         /* New PVM 3.4 Format */ 
 440  
 441         /* Get Task & Host Info */ 
 442  
 443         TT = trc_get_tevtask_tid( ID, src );
 444  
 445         pvmd_tid = pvm_tidtohost( src );
 446  
 447         if ( !pvmd_tid )
 448                 pvmd_tid = pvm_tidtohost( TRC_TID );
 449  
 450         H = trc_get_host_tid( pvmd_tid );
 451  
 452         /* Set Leftover Event Omit Flag */ 
 453  
 454         omit = ( ID->trace_out == NULL 
 455                 || ( TT != NULL && TRC_TASK_OMIT( TT ) ) ) 
 456                         ? TRC_TRUE : TRC_FALSE;
 457  
 458         /* Process Event Message */ 
 459  
 460         nest = 0;
 461  
 462         done = 0;
 463  
 464         do 
 465         {
 466                 switch ( marker ) 
 467                 {
 468                         case TEV_MARK_EVENT_BUFFER: 
 469                         {
 470                                 nest++;
 471  
 472                                 break;
 473                         }
 474  
 475                         case TEV_MARK_EVENT_BUFFER_END: 
 476                         {
   ...
 527                                                 did_done++;
 528                                 }
 529                                 while ( !did_done );
 530  
 531                                 if ( !nest )
 532                                         done++;
 533  
 534                                 break;
 535                         }
 536  
 537                         case TEV_MARK_EVENT_DESC: 
 538                         {
 539                                 TD = trc_create_tevdesc();   /* Leak (ID: 438.29189) */
 540  
 541                                 TD->refcount = 1;
 542  
 543                                 TRC_PVMCKERR( pvm_upkint( &eid, 1, 1 ),
 544                                         "Event Descriptor ID", return( ecnt ) );
 545  
 546                                 TD->eid = eid & ~( TEV_EVENT_ENTRY | TEV_EVENT_EXIT );
 547  
 548                                 if ( eid & TEV_EVENT_ENTRY )
 549                                         TD->entry_exit = TRC_ENTRY_TEV;
 550  
 551                                 else if ( eid & TEV_EVENT_EXIT )
 552                                         TD->entry_exit = TRC_EXIT_TEV;
 553  
 554                                 else 
 555                                         TD->entry_exit = TRC_IGNORE_TEV;
 556  
 557                                 TRC_PVMCKERR( pvm_upkstr( tmp ),
 558                                         "Event Descriptor Name", return( ecnt ) );
 559  
tmp is uninitialized560                                 TD->name = trc_copy_str( tmp );   /* Leak (ID: 22164.29187) */
     /kat0/fletcher/SATE/2010/pvm3/tracer/trcutil.c
     Enter trc_handle_trace_message / trc_copy_str
 3031   char * 
 3032   trc_copy_str( str ) 
 3033   char *str;
 3034   {
 3035           char *tmp;
 3036    
*str is uninitialized3037           tmp = (char *) malloc( (unsigned) (strlen(str) + 1)     /* Uninitialized Variable */  /* 2 more... */
     Exit trc_handle_trace_message / trc_copy_str
Preconditions
&$unknown_11777231 != 0
str[24] >= 0
str[32] = 0
TRC_HOST_LIST->pvmd_tid != &$unknown_11777231
pvmrbuf != 0
pvmtoplvl = 0
Postconditions
TD' = &$heap_414593
TRC_TMP_CC' = 0
TT' = 0
done' = 0
ecnt' = 0
$heap_414593' = 0
bytes_after(&$heap_414593)' = 36
$heap_414593' is allocated by malloc
$heap_414593' is allocated
bytes_before(&$heap_414593)' = 0
((char*)&$heap_414593)[16]' = -1
((char*)&$heap_414593)[20]' = -1
((char*)&$heap_414593)[24]' = 0
((char*)&$heap_414593)[28]' = 1
((char*)&$heap_414593)[32]' = 0
((char*)&$heap_414593)[8]' = 0
((char*)&$heap_414593)[12]' = -1
marker' = -5
nest' = 0
omit' = 1
pvmd_tid' = &$unknown_11777231
str' = &tmp[0]




Change Warning 22165.29194 : Uninitialized Variable

Priority:
State:
Finding:
Owner:
Note: