Text  |   XML   |   Visible Warnings:

pvm3.4.6 : pvm3.4.6 analysis 2 : Null Pointer Dereference  at cons.c:681

Categories: LANG.MEM.NPD CWE:476
Warning ID: 491.29269
Procedure: checkmsgs
Trace: view
Modified: Thu Nov 26 11:36:36 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 (ID: 494.29275) */  /* 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; ) {
dtids <= 4095681                                         if (dtids[j] == hostlist[i].hi_tid) {     /* Null Pointer Dereference */  /* 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_12152489 >= 1
&$unknown_12152497 >= 1
Postconditions
cc' = &$unknown_12152489
dtids' = 0
i' = &$unknown_12152497 - 1
j' = 0
n' = 1
nhosts' = &$unknown_12152497




Change Warning 491.29269 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: