Text  |   XML   |   Visible Warnings:

Pvm : Pvm analysis 1 : Null Pointer Dereference  at msgbox.c:353

Categories: LANG.MEM.NPD CWE:476
Warning ID: 2586.2618
Procedure: mb_insert
Trace: View
Modified: Wed Sep 2 12:41:44 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/msgbox.c
   Enter mb_insert
 321 mb_insert(tid, name, req, flags, mp) 
 322         int tid;                                /* owner task */ 
 323         char *name;                             /* class name */ 
 324         int req;                                /* index requested or -1 for lowest avail */ 
 325         int flags;
 326         struct pmsg *mp;                /* message to store */ 
 327 {
 328         struct pvmmclass *np;
 329         struct pvmmentry *ep;
 330         struct pvmmentry *ep2 = 0;
 331  
 332         int dind;       /* direct index */ 
 333         int cind;       /* current index */ 
 334  
 335         /* must change to always pass in -1 for 3.4 calls */ 
 336         /* then can distinguish between 3.4 reinsert which succeeds 
 337                 if !overwritable/minst & 3.3 reinsert which should fail */ 
 338         /* to fix the "if (ep->me_ind == req)" conditional 
 339                 use a "current index":  cind = ( req == -1 ) ? 0 : req; */ 
 340         /* also, minst supercedes overwritable, else no way to build 
 341                 a minst list from within a single task... */ 
 342  
 343         if (!(np = mc_find(name)))
true344                 if (!(np = mc_new(name)))
 345                         return PvmNoMem;
 346  
 347         dind = PvmMboxDirectIndexOf( flags );
 348  
 349         cind = ( req == -1 ) ? 
 350                 ( ( dind ) ? dind : 0 ) 
 351                 : req;
 352  
np->mc_ent <= 4095353         for (ep = np->mc_ent->me_link; ep != np->mc_ent; ep = ep->me_link)     /* Null Pointer Dereference */
Preconditions
$param_3 = -1
Postconditions
pvmmboxclasses->mc_rlink' = &$heap_38469
pvmmboxclasses->mc_rlink->mc_link' = &$heap_38469
cind' = 0
dind' = 0
ep2' = 0
flags' = $param_4
$heap_38469' = pvmmboxclasses
bytes_after(&$heap_38469)' = 32
$heap_38469' is allocated by malloc
$heap_38469' is allocated
bytes_before(&$heap_38469)' = 0
((char*)&$heap_38469)[16]' = &$heap_38470
((char*)&$heap_38469)[24]' = 0
((char*)&$heap_38469)[8]' = pvmmboxclasses->mc_rlink
$heap_38470' = *$param_2
bytes_after(&$heap_38470)' = strlen($param_2) + 1
$heap_38470' is allocated by malloc
$heap_38470' is allocated
bytes_before(&$heap_38470)' = 0
strlen(&$heap_38470)' = strlen($param_2)
mp' = $param_5
name' = $param_2
np' = &$heap_38469
req' = $param_3
tid' = $param_1




Change Warning 2586.2618 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: