Text  |   XML   |   Visible Warnings:

pvm3.4.6 : pvm3.4.6 analysis 2 : Integer Overflow of Allocation Size  at pvmgsu_aux.c:246

Categories: ALLOC.IOAS BSI:MALLOC-OVERFLOW CWE:680
Warning ID: 22181.29333
Procedure: pvm_reduce
Trace: view
Modified: Thu Nov 26 11:38: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/pvmgs/pvmgsu_aux.c
   Enter pvm_reduce
 202 int pvm_reduce(func, data, count, datatype, msgtag, gname, rootinst) 
 203 #ifdef  IMA_SCO 
 204     void (*func)(int*, void*, void*, int*, int*); 
 205 #else 
 206     void (*func)();
 207 #endif 
 208     void *data;
 209     int count, datatype, msgtag, rootinst;
 210     char *gname;  
 211 {
 212     int cnt, roottid, datasize, cc=PvmOk, rbuf, sbuf;
 213     int coordinator, nmembers_on_host, nhosts_in_group, mask=0;
 214     void *work = NULL;      /* work array to be allocated */ 
 215  
 216     int  (*packfunc)(), (*unpackfunc)();
 217     int x;
 218         int savectx;
 219  
 220         TEV_DECLS 
 221  
 222     BGN_TRACE( TEV_REDUCE, gname, TEV_DID_MC, &msgtag );
 223  
 224     rbuf = pvm_setrbuf(0);            /* set receive buf */ 
 225     sbuf = pvm_mkbuf(PvmDataDefault);
 226     sbuf = pvm_setsbuf(sbuf);
 227  
 228         /* set context for dynamic groups */ 
 229         savectx = pvm_setcontext( SYSCTX_DG );
 230  
 231     if ( (data == NULL) || (count <= 0) ) /* check some parameters */ 
 232     {
 233       cc = PvmBadParam;
 234       goto done;
 235     }
 236    
 237     /* get instance number - caller must be in group, root must be in group */ 
 238     if ( (cc = pvm_getinst(gname, pvmmytid))            < PvmOk ) goto done;
 239     if ( (cc = roottid  = pvm_gettid (gname, rootinst)) < PvmOk ) goto done;
 240     if ( (cc = datasize = gs_get_datasize(datatype))    < PvmOk ) goto done;
 241  
 242     /* set up pointers to the appropriate pack and unpack routines */ 
 243     if ( (cc = gs_pack_unpack(datatype, &packfunc, &unpackfunc) ) < PvmOk)
 244         goto done;
 245  
true246     if ((work = (void *) PVM_ALLOC(count*datasize, "pvm_reduce")) == NULL)     /* Integer Overflow of Allocation Size */
Preconditions
data != 0
count >= 1
datatype <= 7
datatype >= 2
gname >= 0
pvmtoplvl = 0
$input_12 = 0
Postconditions
cc' = 0
datasize' >= 2
datasize' <= 4
mask' = 0
pvmampushed' = 0
pvmamtraced' = pvmtoplvl
rbuf' = -2
roottid' >= 0
work' = 0




Change Warning 22181.29333 : Integer Overflow of Allocation Size

Priority:
State:
Finding:
Owner:
Note: