Text  |   XML   |   Visible Warnings:

pvm3.4.6 : pvm3.4.6 analysis 2 : Null Pointer Dereference  at job.c:288

Categories: LANG.MEM.NPD CWE:476
Warning ID: 487.29261
Procedure: checkoutput
Trace: view
Modified: Thu Nov 26 11:36:29 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
 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: 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 */ 
 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_12112990 >= 1
jp->j_obufs->o_link->o_tid <= tid - 1
((char*)$unknown_12112991)[8] <= tid - 1
jp->j_obufs->o_link != jp->j_obufs
*$unknown_12112991 = jp->j_obufs
pvmtoplvl != 0
Postconditions
((char*)*$unknown_12112991)[12]' = 0
n' = &$unknown_12112990
op' = *$unknown_12112991




Change Warning 487.29261 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: