Text  |   XML   |   Visible Warnings:

pvm3.4.6 : pvm3.4.6 analysis 2 : Integer Overflow of Allocation Size  at pvmgs_func.c:76

Categories: ALLOC.IOAS BSI:MALLOC-OVERFLOW CWE:680
Warning ID: 551.29345
Procedure: gs_realloc_int_array
Trace: view
Modified: Thu Nov 26 11:38:33 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/pvmgs/pvmgs_func.c
   Enter gs_realloc_int_array
 53 int * 
 54 gs_realloc_int_array(nelems, maxelems, array, inc, init, caller) 
 55 int nelems;
 56 int *maxelems;
 57 int *array;
 58 int inc;
 59 int init;
 60 char *caller;
 61 {
 62         int i;
 63         int *newarray, *newvalue;
 64         int oldmax;  
 65         int *value;  
 66  
 67         if (nelems <= *maxelems)  
 68                 return(array);
 69  
 70         newarray = array;   /* Unused Value (ID: 550.29344) */
 71          
 72         oldmax = *maxelems;
 73  
 74         *maxelems += inc;
 75  
true76         if ( (newarray = (int *) PVM_ALLOC(sizeof(int) * (*maxelems), caller))     /* Integer Overflow of Allocation Size */
Preconditions
*maxelems <= nelems - 1
$input_12 = 0
Postconditions
newarray' = array
oldmax' = *maxelems




Change Warning 551.29345 : Integer Overflow of Allocation Size

Priority:
State:
Finding:
Owner:
Note: