Text  |   XML   |   Visible Warnings:

pvm3.4.6 : pvm3.4.6 analysis 2 : Null Pointer Dereference  at task.c:470

Categories: LANG.MEM.NPD CWE:476
Warning ID: 92.28683
Procedure: task_new
Trace: view
Modified: Thu Nov 26 11:27:22 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/src/task.c
   Enter task_new
 439 struct task * 
 440 task_new(tid) 
 441         int tid;
 442 {
 443         struct task *tp, *tp2;
 444  
 445         if (tid) {
 446                 ntasks++;
 447                 if (pvmdebmask & PDMTASK) {
 448                         pvmlogprintf("task_new(%d) ntasks=%d pvm_max_ntasks=%d\n",
 449                                 tid, ntasks, pvm_max_ntasks );
 450                 }
 451                 if (pvm_max_ntasks && ntasks > pvm_max_ntasks) {
 452                         pvmlogprintf("task_new() too many tasks?\n");
 453                         ntasks--;  /* this one didn't make it... :-) */ 
 454                         return( (struct task *) NULL );
 455                 }
 456         }
 457  
 458         if (!(tp = TALLOC(1, struct task, "task"))) {
 459                 pvmlogprintf("task_new() can't get memory\n");
 460                 pvmbailout(0);
 461         }
 462         BZERO((char*)tp, sizeof(struct task));
 463         tp->t_tid = tid;
 464         tp->t_txq = pk_new(0);
 465         tp->t_sock = -1;
 466         tp->t_out = -1;
 467         tp->t_authfd = -1;
 468         tp->t_schedlmsg = 0;
true469         tp->t_ccs = TALLOC(1, struct ccon, "ccon");
tp->t_ccs <= 4095470     tp->t_ccs->c_link = tp->t_ccs->c_rlink = 0;     /* Null Pointer Dereference */
Preconditions
tid != 0
ntasks <= pvm_max_ntasks - 1
pvm_max_ntasks != 0
Postconditions
atnewline' = 1
errno' != 0
$heap_4305' = 0
bytes_after(&$heap_4305)' = 148
$heap_4305' is allocated by malloc
$heap_4305' is allocated
bytes_before(&$heap_4305)' = 0
((char*)&$heap_4305)[144]' = 0
((char*)&$heap_4305)[16]' = tid
((char*)&$heap_4305)[32]' = -1
((char*)&$heap_4305)[60]' = &$heap_4306
((char*)&$heap_4305)[72]' = -1
((char*)&$heap_4305)[80]' = -1
((char*)&$heap_4305)[120]' = 0
$heap_4306' = &$heap_4306
bytes_after(&$heap_4306)' = 120
$heap_4306' is allocated by malloc
$heap_4306' is allocated
bytes_before(&$heap_4306)' = 0
((char*)&$heap_4306)[16]' = 0
((char*)&$heap_4306)[20]' = 0
((char*)&$heap_4306)[4]' = &$heap_4306
((char*)&$heap_4306)[8]' = 0
((char*)&$heap_4306)[116]' = 0
((char*)&$heap_4306)[12]' = 0
ntasks' = ntasks + 1
tmbuf.tm_sec' = &$unknown_164946
tp' = &$heap_4305




Change Warning 92.28683 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: