Text  |   XML   |   Visible Warnings:

pvm3.4.6 : pvm3.4.6 analysis 2 : Integer Overflow of Allocation Size  at cons.c:672

Categories: ALLOC.IOAS BSI:MALLOC-OVERFLOW CWE:680
Warning ID: 494.29275
Procedure: checkmsgs
Trace: view
Modified: Thu Nov 26 11:36:37 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/console/cons.c
   Enter checkmsgs
 654 checkmsgs() 
 655 {
 656         int cc;
 657         int len, cod, src;
 658         int n;
 659         struct job *jp;
 660         int *dtids;
 661         int i, j;
 662         int more, tmp;
 663         struct job *jpnext;
 664  
 665         /* Shit, really need context here to keep old pvm_nrecv(-1,-1)... */ 
 666         /* Should use 2 contexts, one for original console msgs and one   */ 
 667         /*     for tracer stuff...                                        */ 
 668  
 669         /* Get Host Add Notifies */ 
 670         while ((cc = pvm_nrecv(-1, HostsAddedTag)) > 0) {
 671                 pvm_upkint(&n, 1, 1);
true672                 dtids = TALLOC(n, int, "");     /* Integer Overflow of Allocation Size */  /* Uninitialized Variable (ID: 495.29276) */
 673                 pvm_upkint(dtids, n, 1);
 674                 printf("\nConsole: %d new host%s added\n", n, (n == 1 ? "" : "s"));
 675                 pvm_freebuf(cc);
 676                 if (!pvm_config(&nhosts, &narchs, &hostlist)) {
 677                         fputs("                    HOST     DTID     ARCH   SPEED\n",
 678                                         stdout);
 679                         for (j = n; j-- > 0; )
 680                                 for (i = nhosts; i-- > 0; ) {
 681                                         if (dtids[j] == hostlist[i].hi_tid) {   /* Null Pointer Dereference (ID: 491.29269) */  /* Uninitialized Variable (ID: 22176.29268) */
 682                                                 printf("%24s %8x %8s%8d\n",
 683                                                                 hostlist[i].hi_name,
 684                                                                 hostlist[i].hi_tid,
 685                                                                 hostlist[i].hi_arch,
 686                                                                 hostlist[i].hi_speed);
 687                                                 break;
 688                                         }
 689                                 }
 690                 }
 691                 MY_FREE(dtids);   /* Free Null Pointer (ID: 22177.29270) */
Preconditions
&$unknown_12153467 >= 1
&$unknown_12153469 != 0
pvmtoplvl != 0
$input_12 = 0
Postconditions
cc' = &$unknown_12153467
pvmrbuf' = &$unknown_12153469
pvmtrc.trctid' >= 1
pvmtrccodef' = &$unknown_12153468




Change Warning 494.29275 : Integer Overflow of Allocation Size

Priority:
State:
Finding:
Owner:
Note: