Text  |   XML   |   Visible Warnings:

Pvm : Pvm analysis 1 : Null Pointer Dereference  at job.c:288

Categories: LANG.MEM.NPD CWE:476
Warning ID: 2900.2968
Procedure: checkoutput
Trace: View
Modified: Wed Sep 2 12:52:14 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
 252 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 */ 
 282                         if (op->o_buf)
 283                                 op->o_buf = TREALLOC(op->o_buf, op->o_maxl, char);
 284                         else 
true285                                 op->o_buf = TALLOC(op->o_maxl, char, "");
 286                 }
 287                 pvm_upkbyte(op->o_buf + op->o_len, n, 1);
op->o_buf <= 4095288                 op->o_buf[op->o_len + n] = 0;     /* Null Pointer Dereference */
Preconditions
&$unknown_3162067 >= 1
((char*)((char*)*$param_1)[32])[16] <= tid - 1
((char*)$unknown_3162068)[16] <= tid - 1
*$unknown_3162068 != ((char*)*$param_1)[32]
*$unknown_3162068 = ((char*)$param_1)[32]
pvmtoplvl != 0
Postconditions
((char*)*$unknown_3162068)[24]' = 0
((char*)*$unknown_3162068)[36]' >= 0
cc' = $param_2
cod' = $param_4
jp' = $param_1
len' = $param_3
n' = &$unknown_3162067
op' = *$unknown_3162068
src' = $param_5




Change Warning 2900.2968 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: