Text  |   XML   |   Visible Warnings:

Pvm : Pvm analysis 1 : Null Pointer Dereference  at task.c:470

Categories: LANG.MEM.NPD CWE:476
Warning ID: 2498.2528
Procedure: task_new
Trace: View
Modified: Wed Sep 2 12:39:53 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/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
$param_1 != 0
ntasks <= pvm_max_ntasks - 1
pvm_max_ntasks != 0
Postconditions
atnewline' = 1
errno' != 0
$heap_4505' = 0
bytes_after(&$heap_4505)' = 224
$heap_4505' is allocated by malloc
$heap_4505' is allocated
bytes_before(&$heap_4505)' = 0
strlen(&$heap_4505)' = 0
((char*)&$heap_4505)[172]' = 0
((char*)&$heap_4505)[216]' = 0
((char*)&$heap_4505)[32]' = $param_1
((char*)&$heap_4505)[48]' = -1
((char*)&$heap_4505)[80]' = &$heap_4506
((char*)&$heap_4505)[104]' = -1
((char*)&$heap_4505)[120]' = -1
bytes_after(&$heap_4506)' = 184
$heap_4506' is allocated by malloc
$heap_4506' is allocated
bytes_before(&$heap_4506)' = 0
((char*)&$heap_4506)[16]' = 0
((char*)&$heap_4506)[176]' = 0
((char*)&$heap_4506)[24]' = 0
((char*)&$heap_4506)[32]' = 0
((char*)&$heap_4506)[40]' = 0
ntasks' = ntasks + 1
tid' = $param_1
tmbuf.tm_sec' = &$unknown_201034
tp' = &$heap_4505




Change Warning 2498.2528 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: