Text  |   XML   |   Visible Warnings:

pvm3.4.6 : pvm3.4.6 analysis 2 : Null Pointer Dereference  at ddpro.c:3054

Categories: LANG.MEM.NPD CWE:476
Warning ID: 179.28803
Procedure: dm_db
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) 
 2971         || 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;
 2985                 if ((req = mb_insert(tid, name, req, flags, mp3)) < 0)
 2986                         pmsg_unref(mp3);
 2987                 else {
 2988  
 2989                         /* check for any pending requests for this mbox entry */ 
   ...
 3040  
 3041                 }
 3042                 pkint(mp2, req);
 3043                 break;
 3044  
 3045         case TMDB_REMOVE: 
 3046                 req = mb_delete(tid, name, req, flags);
 3047                 pkint(mp2, req);
 3048                 break;
 3049  
 3050         case TMDB_GET: 
 3051                 cc = mb_lookup(tid, name, req, flags, &mp3);
 3052                 if ( cc == PvmNotFound && (flags & PvmMboxWaitForInfo) ) {
true3053                         ep = me_new(req);   /* Leak (ID: 172.28794) */
ep <= 40953054                         ep->me_tid = tid;     /* Null Pointer Dereference */
Preconditions
&$unknown_677225 >= 1
pvmmboxclasses->mc_link != pvmmboxclasses
numfrags = 0
numpmsgs != 0
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
cc' = -32
ep' = 0
errno' != 0
bytes_after(&$heap_71397)' = &$unknown_677225
$heap_71397' is allocated by malloc
bytes_before(&$heap_71397)' = 0
mp2' = freepmsgs.m_link
mp4' = 0
name' = &$heap_71397
opcode' = 3




Change Warning 179.28803 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: