Text  |   XML   |   Visible Warnings:

Pvm : Pvm analysis 1 : Null Pointer Dereference  at lpvmcat.c:380

Categories: LANG.MEM.NPD CWE:476
Warning ID: 2777.2833
Procedure: pvmclaimo
Trace: View
Modified: Wed Sep 2 12:46:18 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
 340 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)
true375                                 op->o_buf = TREALLOC(op->o_buf, op->o_maxl, char);
 376                         else 
 377                                 op->o_buf = TALLOC(op->o_maxl, char, "");
 378                 }
 379                 pvm_upkbyte(op->o_buf + op->o_len, n, 1);
op->o_buf <= 4095380                 op->o_buf[op->o_len + n] = 0;     /* Null Pointer Dereference */
Preconditions
&$unknown_1561277 >= 1
tobuflist->o_link->o_tid = tid
tobuflist->o_link->o_buf != 0
pvmautoerr != 2
pvmautoerr != 3
pvmrbuf != 0
pvmtoplvl != 0
pvmtrc.trctid != pvmmytid
pvmtrc.trctid >= 1
tobuflist = tobuflist->o_link
Postconditions
tobuflist->o_link->o_buf' = 0
tobuflist->o_link->o_maxl' >= 0
mid' = $param_1
n' = &$unknown_1561277
op' = tobuflist->o_link
pvm_errno' = -2




Change Warning 2777.2833 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: