Text  |   XML   |   Visible Warnings:

Pvm : Pvm analysis 1 : Buffer Underrun  at pvmfstartpvmd.c:60

Categories: LANG.MEM.BU CWE:124 CWE:127
Warning ID: 2948.3031
Procedure: pvmfstartpvmd_
Trace: View
Modified: Wed Sep 2 12:54:25 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/libfpvm/LINUX64/pvmfstartpvmd.c
   Enter pvmfstartpvmd_
 30 pvmfstartpvmd_ (args_ptr, block, info, args_len) 
 31 char * args_ptr; int args_len;
 32 int *block;
 33 int *info;
 34 {
 35     char *nargs;                        /* args (null terminated) */ 
 36     int ac = 0;                         /* # of agruments initialize to 0 */ 
 37     char **av;                          /* argument vector */ 
 38     register char *ch;                  /* temp char pointer */ 
 39     register char *beg;                 /* pointer to begining of word */ 
 40     register char *end;                 /* pointer to end of word */ 
 41     register int len;                   /* length of word */ 
 42     register int i;                     /* loop index */ 
 43  
 44 #if ( DEBUG ) 
 45     /* printout incoming nargs */ 
 46     printf( "%d \"%s\"\n", args_len, args_ptr ); 
 47 #endif 
 48     /* Some Fortran compilers allow for strings of zero length */ 
true49     if ( args_len == 0 ) {      /* null args */ 
 50         av = (char **)0;                /* make av a null pointer */ 
 51         goto pvmd;
 52     } else {                            /* something in args */ 
args_len < 053         if ( ( nargs = TALLOC( args_len + 1, char, "nargs" ) ) 
 54             == NULL ) {
 55             pvmlogerror("pvmfstartpvmd() can't get memory\n");
 56             goto bail;
 57         }
 58         /* copy args (ftocptr() could have been used for that) */ 
 59         strncpy( nargs, args_ptr, args_len );
args_len < -1 * bytes_before(nargs)60         nargs[args_len] = '\0'; /* terminate with null */     /* Buffer Underrun */
Preconditions
$param_4 = -1
Postconditions
ac' = 0
args_len' = $param_4
args_ptr' = $param_1
block' = $param_2
bytes_after(&$heap_253635)' = $param_4 + 1
$heap_253635' is allocated by malloc
$heap_253635' is allocated
bytes_before(&$heap_253635)' = 0
info' = $param_3
nargs' = &$heap_253635




Change Warning 2948.3031 : Buffer Underrun

Priority:
State:
Finding:
Owner:
Note: