Text  |   XML   |   Visible Warnings:

pvm3.4.6 : pvm3.4.6 analysis 2 : Uninitialized Variable  at job.c:336

Categories: LANG.MEM.UVAR CWE:457
Warning ID: 490.29265
Similar Warnings: 490.29264
Procedure: checkoutput
Trace: view
Modified: Thu Nov 26 11:36:31 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/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: 22175.29267) */
 272                 if (!(op = obuf_find(jp, tid))) {   /* Uninitialized Variable (ID: 489.29266) */
 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: 489.29262) */
 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_12127277 != 0
&$unknown_12127280 != 0
strlen(&$unknown_12127277) <= 97
strlen(&$unknown_12127277) >= -30
pvmautoerr = 0
pvmtoplvl != 0
Postconditions
*stderr' is allocated by fopen
bytes_before(stderr)' = 0
errno' != 0
n' = -1
newline' = 0
pvm_errno' = -15
pvmmytid' != -1
pvmrbuf' = &$unknown_12127280
td' = &$unknown_12127277




Change Warning 490.29265 : Uninitialized Variable

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