Text  |   XML   |   Visible Warnings:

pvm3.4.6 : pvm3.4.6 analysis 2 : Null Pointer Dereference  at msgbox.c:306

Categories: LANG.MEM.NPD CWE:476
Warning ID: 178.28804
Procedure: mc_find
Trace: view
Modified: Thu Nov 26 11:28:04 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/ddpro.c
   Enter dm_db
 2943 dm_db(hp, mp) 
 2944         struct hostd *hp;
 2945         struct pmsg *mp;
 2946 {
 2947         int opcode;                                     /* op requested */ 
 2948         int tid;
 2949         int req;                                        /* index requested */ 
 2950         int flags;
 2951         char *name = 0;                         /* class name */ 
 2952         struct pmsg *mp2 = 0;           /* reply */ 
 2953         struct pmsg *mp3 = 0;           /* data message */ 
 2954  
 2955         struct waitc *wp, *wp2;         /* wait ctx ptrs (notify, recvinfo */ 
 2956         struct pmsg *mp4 = 0;           /* notify forward message */ 
 2957         struct hostd *hp2;                      /* remote notify host */ 
 2958  
 2959         struct pvmmclass *np, *np2;     /* reset pointers */ 
 2960         struct pvmmentry *ep, *ep2;     /* reset pointers */ 
 2961         int *noresets;                          /* noreset tids */ 
 2962         int nnr;                                        /* # of noreset tasks */ 
 2963         int found;
 2964         int cc;
 2965         int i;
 2966         int notified;
 2967  
 2968         hp = hp;
 2969  
 2970         if (upkint(mp, &opcode) || upkint(mp, &tid) 
true2971         || upkstralloc(mp, &name) || upkint(mp, &req) || upkint(mp, &flags))
 2972                 goto badformat;
 2973  
 2974         mp2 = mesg_new(0);
 2975         mp2->m_dst = mp->m_src;   /* Null Pointer Dereference (ID: 183.28808) */
 2976         mp2->m_tag = DM_DBACK;
 2977         mp2->m_wid = mp->m_wid;
 2978  
 2979         switch (opcode) {
 2980  
 2981         case TMDB_PUT: 
 2982                 mp3 = mesg_new(0);
 2983                 if (pmsg_unpack(mp, mp3))
 2984                         goto badformat;
name <= 40952985                 if ((req = mb_insert(tid, name, req, flags, mp3)) < 0)
     /kat0/fletcher/SATE/2010/pvm3/src/msgbox.c
     Enter dm_db / 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    
name <= 4095343           if (!(np = mc_find(name)))
       Enter dm_db / mb_insert / mc_find
 298     static struct pvmmclass * 
 299     mc_find(name) 
 300             char *name;
 301     {
 302             struct pvmmclass *np;
 303      
 304             for (np = pvmmboxclasses->mc_link; np != pvmmboxclasses;
 305                             np = np->mc_link)
name <= 4095306                     if (!strcmp(np->mc_name, name))     /* Null Pointer Dereference */
       Exit dm_db / mb_insert / mc_find
     Exit dm_db / mb_insert
Preconditions
&$unknown_678670 >= 1
&$unknown_678678 = &$unknown_678677 + 92
pvmmboxclasses->mc_link != pvmmboxclasses
numfrags = 0
numpmsgs = 1
Postconditions
freepmsgs.m_link->m_link->m_rlink' = freepmsgs.m_link->m_rlink
freepmsgs.m_link->m_tag' = -2147352552
freepmsgs.m_link->m_rlink->m_link' = freepmsgs.m_link->m_link
$unknown_678678' = &freepmsgs.m_link
((char*)&$unknown_678678)[4]' = ((char*)&$unknown_678677)[4]
ep2' = 0
errno' != 0
flags' = flags'
freepmsgs.m_link' = &$unknown_678677
freepmsgs.m_rlink' = &$unknown_678678
mp' = &$unknown_678677
mp2' = freepmsgs.m_link
mp3' = &$unknown_678677
mp4' = 0
name' = 0
name' = 0
name' = 0
np' = pvmmboxclasses->mc_link
numpmsgs' = 49
opcode' = 1
req' = req'
tid' = tid'




Change Warning 178.28804 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: