Text  |   XML   |   Visible Warnings:

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

Categories: LANG.MEM.UVAR CWE:457
Warning ID: 492.29272
Similar Warnings: 492.29271, 492.29273
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                         }
 709                         if ( tmp )   /* Uninitialized Variable (ID: 493.29274) */
 710                                 more++;
 711                         if ( jp->j_trcid->complete ) {
 712                                 printf("[%d] finished\n", jp->j_jid - joboffset);
 713                                 job_free(jp);
 714                         }
 715                 }
 716  
 717                 /* Output Job */ 
 718                 else {
 719                         while ((cc = pvm_nrecv(-1, jp->j_jid)) > 0) {
 720                                 pvm_bufinfo(cc, &len, &cod, &src);
cod is uninitialized721                                 checkoutput(jp, cc, len, cod, src);     /* Uninitialized Variable */
Preconditions
&$unknown_12153279 >= 1
joblist->j_link != joblist
pvmautoerr = 0
pvmtoplvl = 0
Postconditions
cc' = &$unknown_12153279
jp' = joblist->j_link
jpnext' = joblist->j_link->j_link
more' = 0
pvm_errno' = -16
pvmmidhsiz' >= 2
pvmmidhsiz' >= &$unknown_12153279 + 1




Change Warning 492.29272 : Uninitialized Variable

Because they are very similar, this warning shares annotations with warnings 492.29271 and 492.29273.
CodeSonar has selected warning 492.29271 to represent this group of similar warnings. In order to edit this group, you must edit warning 492.29271.