Text  |   XML   |   Visible Warnings:

pvm3.4.6 : pvm3.4.6 analysis 2 : Integer Overflow of Allocation Size  at host.c:528

Categories: ALLOC.IOAS BSI:MALLOC-OVERFLOW CWE:680
Warning ID: 70.28656
Procedure: ht_insert
Trace: view
Modified: Thu Nov 26 11:27:16 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/host.c
   Enter ht_insert
 507 ht_insert(htp, hp) 
 508         struct htab *htp;
 509         struct hostd *hp;
 510 {
 511         int hh;
 512         int i;
 513         unsigned long mask = 0, tmpmask;
 514  
 515         int *dsigs;
 516         int ndsigs;
 517         int found;
 518         int d;
 519  
 520         hh = (hp->hd_hostpart & tidhmask) >> (ffs(tidhmask) - 1);
 521  
 522         /* extend ht_hosts[] if no room */ 
 523  
 524         if (hh > htp->ht_last) {
 525                 int n = htp->ht_last;
 526  
 527                 htp->ht_last = (hh * 3) / 2;
true528                 htp->ht_hosts = TREALLOC(htp->ht_hosts, htp->ht_last + 1, struct hostd*);     /* Integer Overflow of Allocation Size */
Preconditions
htp->ht_hosts = 0
Postconditions
hh' >= htp->ht_last + 1
mask' = 0
n' = htp->ht_last




Change Warning 70.28656 : Integer Overflow of Allocation Size

Priority:
State:
Finding:
Owner:
Note: