Text  |   XML   |   Visible Warnings:

pvm3.4.6 : pvm3.4.6 analysis 2 : Uninitialized Variable  at cons.c:709

Categories: LANG.MEM.UVAR CWE:457
Warning ID: 493.29274
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
true654 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);
 672                 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; ) {
 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) */
 692         }
 693  
 694         /* Poll Jobs...  This Sux...  Needs Context... */ 
 695  
 696         jp = joblist->j_link;
 697  
 698         more = 0;
 699  
 700         while (jp != joblist) {
 701  
 702                 jpnext = jp->j_link;
 703  
 704                 /* Trace Job */ 
 705                 if (jp->j_flag & JOB_TRACE) {
 706                         if (trc_recv_messages(jp->j_trcid, 10, &tmp) > 0 ) {
 707                                 fflush(jp->j_trcid->trace_out);
 708                         }
tmp is uninitialized709                         if ( tmp )     /* Uninitialized Variable */
Preconditions
joblist->j_link != joblist
TRC_HOST_ADD_NOTIFY_CODE = -1
Postconditions
cc' <= 0
jp' = joblist->j_link
jpnext' = joblist->j_link->j_link
more' = 0




Change Warning 493.29274 : Uninitialized Variable

Priority:
State:
Finding:
Owner:
Note: