Text  |   XML   |   Visible Warnings:

pvm3.4.6 : pvm3.4.6 analysis 2 : Unreachable Call  at pvmcruft.c:777

Categories: LANG.STRUCT.UC CWE:561
Warning ID: 236.28873
Procedure: pvmtmpnam
Trace: view
Modified: Thu Nov 26 11:28:19 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     
LineSource
  /kat0/fletcher/SATE/2010/pvm3/src/pvmcruft.c
  Enter pvmtmpnam
744 char * 
745 pvmtmpnam(buf) 
746         char *buf;
747 {
748         static int f = 0;
749         static int n = 0;
750         static char scratch[255];
751  
752         char *pvmtmp;
753  
754         if (!buf)
755                 buf = scratch;
756  
757         pvmtmp = pvmgettmp();
758  
759 #ifndef WIN32 
760         sprintf(buf, "%s/pvmtmp%06d.%d", pvmtmp, getpid(), n);   /* Buffer Overrun (ID: 237.28874) */
761 #else 
762         sprintf(buf, "%s\\pvmtmp%06d.%d", pvmtmp, getpid(), n); 
763 #endif 
764  
765         /* Silly Hack to avoid stomping on pvmd's first pvmtmpnam()
766                 call to get it's socket file... :-) */ 
767         n = 1 + (f++ % 10000);
768  
769         /* Better Check for String Overflow... */ 
770         /* (Late Check is Better Than No Check... :-) */ 
771  
772         if ( strlen( buf ) >= PVMTMPNAMLEN ) {
773                 pvmlogperror("Whoa!  PVMTMPNAMLEN Overflow in pvmtmpnam()...");
774                 pvmlogprintf("<%s> = %d >= %d", buf, strlen( buf ),
775                                 PVMTMPNAMLEN);
776                 pvmbailout(0);
777                 exit(1);                /* the other meaning of bail out */     /* Unreachable Call */
778         }
779  
780         return buf;
781 } 




Change Warning 236.28873 : Unreachable Call

Priority:
State:
Finding:
Owner:
Note: