Text  |   XML   |   Visible Warnings:

Pvm : Pvm analysis 1 : Uninitialized Variable  at job.c:336

Categories: LANG.MEM.UVAR CWE:457
Warning ID: 2903.2972
Similar Warnings: 2903.2971
Procedure: checkoutput
Trace: View
Modified: Wed Sep 2 12:52:20 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/console/job.c
   Enter checkoutput
true252 checkoutput(jp, cc, len, cod, src) 
 253         struct job *jp;
 254         int cc;                                 /* message mid */ 
 255         int len;
 256         int cod;
 257         int src;
 258 {
 259         int tid;                                        /* task */ 
 260         int n;                                          /* length or event code */ 
 261         char *p;
 262         int ptid;
 263         struct obuf *op;
 264         int show;
 265  
 266         show = pvm_getopt( PvmShowTids );
 267  
 268         pvm_upkint(&tid, 1, 1);
 269         pvm_upkint(&n, 1, 1);
 270  
 271         if (n > 0) {   /* Uninitialized Variable (ID: 2904.2974) */
 272                 if (!(op = obuf_find(jp, tid))) {   /* Uninitialized Variable (ID: 2901.2973) */
 273                         printf("Bogus message, job %d has no task t%x\n",
 274                                         jp->j_jid - joboffset, tid);
 275                         goto hork;
 276                 }
 277                 if (n + op->o_len >= op->o_maxl) {
 278                         op->o_maxl = op->o_len + n + 1;
 279 /*
 280                         printf("REALLOC t%x buf to %d\n", tid, op->o_maxl);
 281 */ 
   ...
 298                                 fprintf((jp->j_ff ? jp->j_ff : stdout),
 299                                                 "[%d:t%x] ", jp->j_jid - joboffset, tid);
 300                         fprintf((jp->j_ff ? jp->j_ff : stdout),
 301                                         "%s\n", op->o_buf);
 302                         op->o_len -= p - op->o_buf;
 303                         if ( !(op->o_len) ) break;
 304                         BCOPY(p, op->o_buf, op->o_len);
 305                         p = op->o_buf;
 306                 }
 307  
 308         } else {
 309                 switch (n) {
 310  
 311                 case 0
 312                         if (!(op = obuf_find(jp, tid))) {   /* Uninitialized Variable (ID: 2901.2969) */
 313                                 printf("Bogus message, job %d has no task t%x\n",
 314                                                 jp->j_jid - joboffset, tid);
 315                                 goto hork;
 316                         }
 317                         if (op->o_len > 0) {
 318                                 if ( show )
 319                                         fprintf((jp->j_ff ? jp->j_ff : stdout),
   ...
 325                         op->o_flag |= GOTEOF;
 326                         if (op->o_flag == (GOTSPAWN|GOTEOF)) {
 327                                 if ( show )
 328                                         fprintf((jp->j_ff ? jp->j_ff : stdout),
 329                                                         "[%d:t%x] EOF\n", jp->j_jid - joboffset,
 330                                                         tid);
 331                                 obuf_free(jp, op);
 332                         }
 333                         break;
 334  
 335                 case -1: 
tid is uninitialized336                         if (!(op = obuf_find(jp, tid)))     /* Uninitialized Variable */
Preconditions
&$unknown_3189367 != 0
&$unknown_3189368 = 1
&$unknown_3189369 = 1
pvmautoerr != 0
pvmautoerr != 2
pvmautoerr != 3
pvmtoplvl != 0
$input_12 >= 0
Postconditions
*stderr' is allocated by fopen
bytes_before(stderr)' = 0
cc' = $param_2
cod' = $param_4
errno' != 0
bytes_after(&$heap_236913)' = $input_12 + 1
$heap_236913' is allocated by malloc
$heap_236913' is a non-heap object
bytes_before(&$heap_236913)' = 0
strlen(&$heap_236913)' = $input_12
jp' = $param_1
len' = $param_3
n' = -1
newline' = 0
pvm_errno' = -15
pvmmytid' = -1
pvmrbuf' = &$unknown_3189367
src' = $param_5
td' = &$heap_236913




Change Warning 2903.2972 : Uninitialized Variable

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