Text  |   XML   |   Visible Warnings:

pvm3.4.6 : pvm3.4.6 analysis 2 : Buffer Overrun  at tracer.c:497

Categories: LANG.MEM.BO CWE:120 CWE:121 CWE:122 CWE:126
Warning ID: 454.29213
Procedure: program_init
Trace: view
Modified: Thu Nov 26 11:36:10 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/tracer.c
   Enter program_init
 455 program_init() 
 456 {
 457         struct passwd *pw;
 458  
 459         char hname[1024];
 460         char pvstr[255];
 461         char tmp[2048];
 462  
 463 #ifdef WIN32 
 464         char *username = 0;
 465         char *pstr; 
   ...
 471         char *home;
 472  
 473         int entry_exit;
 474         int release;
 475         int version;
 476         int fmt;
 477         int i;
 478  
 479         /* Get User Name for Trace File */ 
 480  
 481         if ( TRACE_FILE == NULL )
 482         {
$input_12 > 2025483                 pvmtmp = pvmgettmp();
 484  
 485 #ifndef WIN32 
 486                 if ( (pw = getpwuid( getuid() )) != NULL )
 487                         sprintf( tmp, "%s/tracefile.%s", pvmtmp, pw->pw_name );   /* Buffer Overrun (ID: 455.29214) */
 488 #else 
 489                 if ( !username )
 490                         username = (char *) MyGetUserName();
 491  
 492                 if ( username )
 493                         sprintf( tmp, "%s\\tracefile.%s", pvmtmp, username ); 
 494 #endif           
 495                 else 
 496 #ifndef WIN32 
strlen(pvmtmp) > 2025497                         sprintf( tmp, "%s/tracefile.%d", pvmtmp, getpid() );     /* Buffer Overrun */
Preconditions
TRACE_FILE = 0
$input_12 >= 0
td = 0
Postconditions
errno' != 0
$heap_431621' = $input_444
bytes_after(&$heap_431621)' = $input_12 + 1
$heap_431621' is allocated by malloc
$heap_431621' is a non-heap object
bytes_before(&$heap_431621)' = 0
strlen(&$heap_431621)' = $input_12
pvmtmp' = &$heap_431621
pw' = 0
td' = &$heap_431621




Change Warning 454.29213 : Buffer Overrun

Priority:
State:
Finding:
Owner:
Note: