Text  |   XML   |   Visible Warnings:

pvm3.4.6 : pvm3.4.6 analysis 2 : Buffer Overrun  at trcfile.c:2631

Categories: LANG.MEM.BO CWE:120 CWE:121 CWE:122 CWE:126
Warning ID: 472.29238
Similar Warnings: 472.29236
Procedure: trc_read_trace_event
Trace: view
Modified: Thu Nov 26 11:36:24 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_read_trace_event
 2421 trc_read_trace_event( ID, eof ) 
 2422 TRC_ID ID;
 2423 int *eof;
 2424 {
 2425         TRC_TEVDESC TD;
 2426  
 2427         char tmp[4096];
 2428         char c;
 2429  
 2430         int entry_exit;
 2431         int dummy;
 2432         int index;
 2433         int code;
 2434         int flag;
 2435         int eid;
 2436         int ee;
 2437         int i;
 2438  
 2439         *eof = TRC_FALSE;
 2440  
 2441         if ( ID->trace_in == NULL )
 2442                 return( TRC_FALSE );
 2443  
 2444         while ( TRC_TRUE )
 2445         {
 2446                 c = getc( ID->trace_in );
 2447  
 2448                 if ( c != (char) EOF )
 2449                 {
 2450                         switch ( c ) 
 2451                         {
 2452                                 /* Record Descriptor Packet */ 
 2453  
 2454                                 case '#': 
 2455                                 {
 2456                                         /* Get event ID */ 
 2457  
 2458                                         flag = fscanf( ID->trace_in, "%d", &code );
 2459  
 2460                                         if ( flag != 1 )
   ...
 2608  
 2609                                                 if ( ID->handle_old_descriptor )
 2610                                                         (ID->handle_old_descriptor)( ID, TD );
 2611                                         }
 2612  
 2613                                         break;
 2614                                 }
 2615  
 2616                                 /* Record Data Packet */ 
 2617  
 2618                                 case '"': 
 2619                                 {
$input_666780 > 40952620                                         i = 0;
 2621  
 2622                                         while ( (c = getc( ID->trace_in )) != (char) EOF 
 2623                                                 && c != '"' && c != '(' )
 2624                                         {
 2625                                                 tmp[i++] = c;   /* Buffer Overrun (ID: 471.29237) */
 2626                                         }
 2627  
 2628                                         TRC_CKEOF( c, "EOF Reading Event Record Name\n",
 2629                                                 return( TRC_FALSE ) );
 2630  
i > 40952631                                         tmp[i] = '\0';     /* Buffer Overrun */
Preconditions
$input_12 = 34
$input_666780 >= 1
$input_667140 != 34
$input_667140 != 40
$input_667140 <= 254
$input_667140 >= -1
$input_667148 = 34
Postconditions
c' = $input_667148
i' = $input_666780




Change Warning 472.29238 : Buffer Overrun

Because they are very similar, this warning shares annotations with warning 472.29236.
CodeSonar has selected warning 472.29236 to represent this group of similar warnings. In order to edit this group, you must edit warning 472.29236.