Text  |   XML   |   Visible Warnings:

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

Categories: ALLOC.IOAS BSI:MALLOC-OVERFLOW CWE:680
Warning ID: 375.29072
Procedure: pvm_getnoresets
Trace: view
Modified: Thu Nov 26 11:30:59 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_getnoresets
 1865 pvm_getnoresets( tids, ntids ) 
 1866         int **tids;
 1867         int *ntids;
 1868 {
 1869         static int *tidlist = (int *) NULL;
 1870         static int num = 0;
 1871  
 1872         int index;
 1873         int done;
 1874         int save;
 1875         int mid;
 1876         int cnt;
 1877  
 1878         /* Allocate Initial Tids List */ 
 1879  
 1880         if ( !tidlist )
 1881         {
 1882                 num = 16;
 1883                 tidlist = TALLOC( num, int, "int" );
 1884         }
 1885  
 1886         /* Save Receive Buffer */ 
 1887  
 1888         save = pvm_setrbuf( 0 );
 1889  
 1890         /* Search for No Resets */ 
 1891  
 1892         index = 0;
 1893         done = 0;
 1894         cnt = 0;
 1895  
 1896         while ( !done )
 1897         {
 1898                 if ( pvm_recvinfo( PVMNORESETCLASS, index, PvmMboxFirstAvail ) 
 1899                                 <= 0 )
 1900                 {
 1901                         done++;
 1902                 }
 1903  
 1904                 else 
 1905                 {
 1906                         if ( cnt >= num )
 1907                         {
 1908                                 num *= 2;
 1909  
true1910                                 tidlist = TREALLOC( tidlist, num, int );     /* Integer Overflow of Allocation Size */
 1911                         }
 1912  
 1913                         pvm_upkint( &(tidlist[cnt++]), 1, 1 );
 1914  
 1915                         index++;
Preconditions
&$unknown_2993763 >= 1
tidlist = 0
Postconditions
done' = 0
bytes_before(&$heap_369036)' = 0
save' = -2




Change Warning 375.29072 : Integer Overflow of Allocation Size

Priority:
State:
Finding:
Owner:
Note: