Text  |   XML   |   Visible Warnings:

pvm3.4.6 : pvm3.4.6 analysis 2 : Uninitialized Variable  at trcmess.c:227

Categories: LANG.MEM.UVAR CWE:457
Warning ID: 450.29209
Procedure: trc_recv_messages
Trace: view
Modified: Thu Nov 26 11:36:08 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_recv_messages
true42 trc_recv_messages( ID, max_count, status ) 
 43 TRC_ID ID;
 44 int max_count;
 45 int *status;
 46 {
 47         static int *tids = (int *) NULL;
 48         static int ntids = 0;
 49  
 50         TRC_HOST H;
 51  
 52         TRC_ID DEAD_ID_last;
   ...
 61         int mid;
 62         int num;
 63         int tid;
 64         int src;
 65         int tmp;
 66         int cc;
 67         int i;
 68  
 69         /* Verify Message Codes Set */ 
 70  
 71         if ( TRC_HOST_ADD_NOTIFY_CODE == -1 
 72                 || TRC_HOST_DEL_NOTIFY_CODE == -1 
 73 #ifndef USE_PVM_33 
 74                 || ID->event_ctx == -1 || ID->output_ctx == -1 
 75 #endif 
 76                 || ID->event_tag == -1 || ID->output_tag == -1 )
 77         {
 78                 printf( "Error: Message Codes Not Set - %d %d %d %d %d %d\n",
 79                         TRC_HOST_ADD_NOTIFY_CODE, TRC_HOST_DEL_NOTIFY_CODE,
 80                         ID->event_ctx, ID->output_ctx,
 81                         ID->event_tag, ID->output_tag );
 82  
 83                 return( -1 );
 84         }
 85  
 86         /* Clear Out Flags */ 
 87  
 88         if ( status != NULL )
 89                 *status = TRC_MSG_STATUS_NONE;
 90  
 91         /* Init Event Counter */ 
 92  
 93         ecnt = 0;
 94  
 95         /* Check for Host Sync Updates */ 
 96  
 97         ecnt += trc_check_host_sync( ID );   /* Useless Assignment (ID: 448.29205) */
 98  
 99         /* Receive Stuff */ 
 100  
 101         cnt = 0;
 102  
 103         while ( cnt < max_count 
 104                 && (mid = trc_get_msg( ID, &len, &msgtag, &src, &others )) > 0 )
 105         {
 106                 /* Set Activity Flag */ 
 107  
 108                 if ( status != NULL )
 109                         *status |= TRC_MSG_STATUS_ACTIVE;
 110  
 111                 /* Host Added */ 
 112  
 113                 if ( msgtag == TRC_HOST_ADD_NOTIFY_CODE && src == 0x80000000 )
   ...
 200                                 "Tracer:  msg from 0x%x code %d len %d ?\n",
 201                                 src, msgtag, len );
 202                 }
 203  
 204                 if ( pvm_freebuf( mid ) < 0 )
 205                         pvm_perror( "Error Freeing Message Buffer" );
 206  
 207                 cnt++;
 208         }
 209  
 210         if ( mid < 0 )   /* Uninitialized Variable (ID: 451.29210) */
 211         {
 212                 pvm_perror( "PVM System Failure" );
 213  
 214                 printf( "Tracer exiting...\n" );
 215  
 216                 return( -1 );
 217         }
 218  
 219         if ( status != NULL )
 220         {
 221                 if ( cnt == max_count )
 222                         *status |= TRC_MSG_STATUS_MORE;
 223         }
 224  
 225         /* Try Flushing Dead IDs */ 
 226  
others is uninitialized227         if ( others )     /* Uninitialized Variable */
Preconditions
max_count = 0
ID->output_ctx != -1
ID->output_tag != -1
ID->event_ctx != -1
ID->event_tag != -1
TRC_HOST_ADD_NOTIFY_CODE != -1
TRC_HOST_DEL_NOTIFY_CODE != -1
mid >= 0
Postconditions
cnt' = 0
ecnt' = 0




Change Warning 450.29209 : Uninitialized Variable

Priority:
State:
Finding:
Owner:
Note: