Text  |   XML   |   Visible Warnings:

Pvm : Pvm analysis 1 : Buffer Overrun  at cmds.c:757

Categories: LANG.MEM.BO CWE:120 CWE:121 CWE:122 CWE:126
Warning ID: 2913.2995
Procedure: diagnose_cant_start_pvm
Trace: View
Modified: Wed Sep 2 12:52:41 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
   /u1/paul/SATE/2010/c/pvm/pvm3/console/cmds.c
   Enter diagnose_cant_start_pvm
 678 diagnose_cant_start_pvm( hostline ) 
 679 char *hostline;
 680 {
 681         FILE *fp;
 682  
 683 #ifndef WIN32 
 684         struct passwd *pw;
 685 #endif 
 686  
 687         struct hostd hp;
 688  
   ...
 691         char lhost[1024];
 692         char pvmarch[1024];
 693         char pvmroot[1024];
 694         char pvmtmp[1024];
 695         char result[1024];
 696         char result2[1024];
 697         char tcmd[1024];
 698         char tmp[255];
 699         char user[1024];
 700  
 701         int remote_os = -1;
 702         int len;
 703         int i;
 704  
 705         /* Extract Raw Host Name from Add Command */ 
 706  
 707         if ( parsehost(hostline, &hp) < 0 ) {
 708                 printf( "Error Parsing Host String!\n" );
 709                 printf( "Cannot Auto-Diagnose!\n" );
 710                 return( 0 );
 711         }
 712  
 713         /* Get Local Hostname */ 
 714  
 715         gethostname( lhost, 1024 );
 716  
 717         /* Get Local User */ 
 718  
 719 #ifndef WIN32 
 720         if ( (pw = getpwuid( getuid() )) != NULL )
 721                 strcpyuser, pw->pw_name );
 722         else 
 723                 strcpy( user, "<your_user_name>" );
 724 #else 
 725         strcpy( user, MyGetUserName() ); 
 726 #endif 
 727  
 728         /* Ping / Timeout Test */ 
 729  
 730         /*
 731          * Maybe later - for now rsh returns "Connection timed out"
 732          *
 733         printf( "Pinging Host \"%s\"...\n", hp.hd_name );
   ...
 745                 fclose( fp );
 746         }
 747         else 
 748                 printf( "Ping Command Failed - Test Skipped...\n" );
 749  
 750         unlink( tfile );
 751         */ 
 752  
 753         /* Verify Rsh Path */ 
 754  
 755         printf( "Verifying Local Path to \"rsh\"...\n" );
 756  
$input_12 > 1023757         strcpy( tcmd, pvmgetrsh() );     /* Buffer Overrun */
Preconditions
*$param_1 != 0
strlen($param_1) != 0
rd = 0
$input_12 >= 0
Postconditions
errno' != 0
$heap_239855' = $input_60
bytes_after(&$heap_239855)' = $input_12 + 1
$heap_239855' is allocated by malloc
$heap_239855' is a non-heap object
bytes_before(&$heap_239855)' = 0
strlen(&$heap_239855)' = $input_12
hostline' = $param_1
hp.hd_arch' = 0
pw' = 0
rd' = &$heap_239855
remote_os' = -1
tcmd[0]' = $input_60
user[0]' = 60
strlen(&user[0])' = 16




Change Warning 2913.2995 : Buffer Overrun

Priority:
State:
Finding:
Owner:
Note: