Text  |   XML   |   Visible Warnings:

Pvm : Pvm analysis 1 : Uninitialized Variable  at lpvmcat.c:439

Categories: LANG.MEM.UVAR CWE:457
Warning ID: 2778.2837
Similar Warnings: 2778.2834, 2778.2835, 2778.2838
Procedure: pvmclaimo
Trace: View
Modified: Wed Sep 2 12:46:25 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
   /u1/paul/SATE/2010/c/pvm/pvm3/src/lpvmcat.c
   Enter pvmclaimo
true340 pvmclaimo(mid) 
 341         int mid;
 342 {
 343         int tid;                                        /* task */ 
 344         int n;                                          /* length or event code */ 
 345         char *p;
 346         int ptid;
 347         struct tobuf *op;
 348  
 349 /*
 350         if (TRACE) {
 351                 checktrace(jp, cc, len, cod, src);
 352                 return 0;
 353         }
 354 */ 
 355  
 356         pvm_upkint(&tid, 1, 1);
 357         pvm_upkint(&n, 1, 1);
 358  
 359         if (!tobuflist) {
 360                 pvmlogprintf("pvmclaimo() message from task t%x\n", tid);   /* Uninitialized Variable (ID: 2781.2840) */
 361                 goto done;
 362         }
 363  
 364         if (n > 0) {    /* output printed by task */   /* Uninitialized Variable (ID: 2780.2839) */
 365                 if (!(op = tobuf_find(tid))) {   /* Uninitialized Variable (ID: 2778.2838) */
 366                         pvmlogprintf("pvmclaimo() bogus message, no task t%x\n", tid);
 367                         goto done;
 368                 }
 369                 if (n + op->o_len >= op->o_maxl) {
 370                         op->o_maxl = op->o_len + n + 1;
 371 /*
 372                         printf("REALLOC t%x buf to %d\n", tid, op->o_maxl);
 373 */ 
 374                         if (op->o_buf)
   ...
 389                         if (outlogff)
 390                                 if (pvmshowtaskid)
 391                                         fprintf(outlogff, "[t%x] %s\n", tid, op->o_buf);
 392                                 else 
 393                                         fprintf(outlogff, "%s\n", op->o_buf);
 394                         op->o_len -= p - op->o_buf;
 395                         BCOPY(p, op->o_buf, op->o_len + 1);
 396                         p = op->o_buf;
 397                 }
 398  
 399         } else {
 400                 switch (n) {
 401  
 402                 case TO_EOF:    /* EOF from task */ 
 403                         if (!(op = tobuf_find(tid))) {   /* Uninitialized Variable (ID: 2778.2835) */
 404                                 pvmlogprintf("pvmclaimo() bogus message, no task t%x\n", tid);
 405                                 goto done;
 406                         }
 407                         if (op->o_len > 0) {
 408                                 if (outlogff)
 409                                         if (pvmshowtaskid)
 410                                                 fprintf(outlogff, "[t%x] %s\n", tid, op->o_buf);
   ...
 428                         }
 429                         op->o_flag |= GOTSPAWN;
 430                         if ((op->o_flag & TASKSTATE) == GOTBOTH) {
 431                                 if (outlogff && pvmshowtaskid)
 432                                         fprintf(outlogff, "[t%x] EOF\n", tid);
 433                                 tobuf_free(op);
 434                         }
 435  
 436                         break;
 437  
 438                 case TO_NEW:    /* new task starting up */ 
tid is uninitialized439                         if (!(op = tobuf_find(tid))) {     /* Uninitialized Variable */
Preconditions
&$unknown_1585619 != 0
&$unknown_1585620 = 1
&$unknown_1585621 = 1
myfmt != -1
pvmautoerr != 0
pvmautoerr != 2
pvmautoerr != 3
pvmmytid = -1
pvmrbuf = 0
pvmtoplvl != 0
$input_12 >= 0
tobuflist != 0
Postconditions
*stderr' is allocated by fopen
bytes_before(stderr)' = 0
errno' != 0
bytes_after(&$heap_175772)' = $input_12 + 1
$heap_175772' is allocated by malloc
$heap_175772' is a non-heap object
bytes_before(&$heap_175772)' = 0
strlen(&$heap_175772)' = $input_12
mid' = $param_1
n' = -2
newline' = 0
pvm_errno' = -15
pvmmytid' = -1
pvmrbuf' = &$unknown_1585619
td' = &$heap_175772




Change Warning 2778.2837 : Uninitialized Variable

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