Text  |   XML   |   Visible Warnings:

pvm3.4.6 : pvm3.4.6 analysis 2 : Integer Overflow of Allocation Size  at lpvmgen.c:4685

Categories: ALLOC.IOAS BSI:MALLOC-OVERFLOW CWE:680
Warning ID: 22134.29109
Procedure: pvm_getmboxinfo
Trace: view
Modified: Thu Nov 26 11:32:53 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/src/lpvmgen.c
   Enter pvm_getmboxinfo
 4631 pvm_getmboxinfo(pattern, nclasses, classes) 
 4632         char *pattern;                                  /* class name */ 
 4633         int *nclasses;                                  /* number of classes returned */ 
 4634         struct pvmmboxinfo **classes;   /* name list returned */ 
 4635 {
 4636         static struct pvmmboxinfo *clist = (struct pvmmboxinfo *) NULL;
 4637         static int nclist = 0;
 4638  
 4639         int sbf, rbf, cc;
 4640         int i, j;
 4641         TEV_DECLS 
 4642  
 4643         if (TEV_EXCLUSIVE) {
 4644                 if (TEV_DO_TRACE(TEV_GETMBOXINFO,TEV_EVENT_ENTRY)) {
 4645                         TEV_PACK_STRING( TEV_DID_CN, TEV_DATA_SCALAR,
 4646                                 pattern ? pattern : "", 1, 1 );
 4647                         TEV_FIN;
 4648                 }
 4649         }
 4650  
 4651         if ( !pattern )
 4652                 pattern = "";
 4653  
 4654         if ( clist ) {
 4655                 for ( i=0 ; i < nclist ; i++ ) {
 4656                         if ( clist[i].mi_name )
 4657                                 PVM_FREE( clist[i].mi_name );
 4658                         if ( clist[i].mi_indices )
 4659                                 PVM_FREE( clist[i].mi_indices );
 4660                         if ( clist[i].mi_owners )
 4661                                 PVM_FREE( clist[i].mi_owners );
 4662                         if ( clist[i].mi_flags )
 4663                                 PVM_FREE( clist[i].mi_flags );
 4664                 }
 4665                 PVM_FREE( clist );
 4666                 clist = (struct pvmmboxinfo *) NULL;
 4667                 nclist = 0;
 4668         }
 4669  
 4670         if ( !(cc = BEATASK) )
 4671         {
 4672                 sbf = pvm_setsbuf( pvm_mkbuf( PvmDataFoo ) );
 4673                 rbf = pvm_setrbuf( 0 );
 4674                 cc = TMDB_NAMES;
 4675                 pvm_pkint( &cc, 1, 1 );
 4676                 pvm_pkint( &pvmmytid, 1, 1 );
 4677                 pvm_pkstr( pattern );
 4678                 cc = 0;
 4679                 pvm_pkint( &cc, 1, 1 );
 4680                 pvm_pkint( &cc, 1, 1 );
 4681                 if ( (cc = msendrecv( TIDPVMD, TM_DB, SYSCTX_TM )) > 0 ) {
 4682                         pvm_upkint( &cc, 1, 1 );
 4683                         if ( cc >= 0 ) {
 4684                                 pvm_upkint( &nclist, 1, 1 );
true4685                                 clist = TALLOC( nclist, struct pvmmboxinfo, "classes" );     /* Integer Overflow of Allocation Size */
Preconditions
&$unknown_7541126 >= 1
nclist >= 2
pvmautoerr != 2
pvmautoerr != 3
pvmmytid = -1
pvmtoplvl != 0
pvmtrc.trctid >= 1
pvmtrc.trcopt != 1
pvmtrc.trcopt != 2
pvmtrc.trcopt != 3
$input_12 = 0
Postconditions
*clist' is freed
cc' >= 0
clist' = 0
i' = nclist
pvm_errno' = -2
pvmampushed' = 0
pvmamtraced' = pvmtoplvl
pvmmytid' != -1
pvmtoplvl' = 0
pvmtrccodef' = &pvmtrccodef_nop.enc_byte
rbf' = -2




Change Warning 22134.29109 : Integer Overflow of Allocation Size

Priority:
State:
Finding:
Owner:
Note: