Text  |   XML   |   Visible Warnings:

Pvm : Pvm analysis 1 : Null Pointer Dereference  at tdpro.c:2502

Categories: LANG.MEM.NPD CWE:476
Warning ID: 2735.2788
Procedure: tm_tracer
Trace: View
Modified: Wed Sep 2 12:44:37 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/tdpro.c
   Enter tm_tracer
 2412 tm_tracer(tp, mp) 
 2413         struct task *tp;
 2414         struct pmsg *mp;
 2415 {
 2416         int regme;
 2417         int tctx;
 2418         int ttag;
 2419         int octx;
 2420         int otag;
 2421         Pvmtmask tmask;
 2422         int tbuf;
 2423         int topt;
 2424         struct pmsg *mp2;
 2425         struct pmsg *mpd;
 2426         int slconf;
 2427         int hh;
 2428         struct hostd *hp;
 2429         char buf[512];
 2430  
 2431         if (upkint(mp, &regme)) {
 2432                 pvmlogerror("tm_tracer() bad msg format\n");
 2433                 return 0;
 2434         }
 2435  
 2436         mp2 = replymessage(mp);
 2437  
 2438         slconf = 0;
 2439  
 2440         if (regme) {
 2441                 if (pvmtracer.trctid) {
 2442                         pkint(mp2, PvmAlready);
 2443  
 2444                 } else {
 2445                         tp->t_flag |= TF_ISTRACER;
 2446                         upkint(mp, &tctx);
 2447                         upkint(mp, &ttag);
 2448                         upkint(mp, &octx);
 2449                         upkint(mp, &otag);
 2450                         upkstr(mp, tmask, TEV_MASK_LENGTH);
 2451                         upkint(mp, &tbuf);
 2452                         upkint(mp, &topt);
 2453                         pvmtracer.trctid = tp->t_tid;
 2454                         pvmtracer.trcctx = tctx;
 2455                         pvmtracer.trctag = ttag;
 2456                         pvmtracer.outtid = tp->t_tid;
 2457                         pvmtracer.outctx = octx;
 2458                         pvmtracer.outtag = otag;
 2459                         BCOPY(tmask,pvmtracer.tmask,TEV_MASK_LENGTH);
 2460                         pvmtracer.trcbuf = tbuf;
 2461                         pvmtracer.trcopt = topt;
 2462                         slconf++;
 2463                         if (pvmdebmask & PDMTRACE) {
 2464                                 pvmlogprintf("tm_tracer() register t%x \n", tp->t_tid);
 2465                         }
 2466                         pkint(mp2, 0);
 2467                 }
 2468  
 2469         } else {
 2470                 if (pvmtracer.trctid == tp->t_tid) {
 2471                         tp->t_flag &= ~TF_ISTRACER;
 2472                         pvmtracer.trctid = 0;
 2473                         pvmtracer.trcctx = 0;
 2474                         pvmtracer.trctag = 0;
 2475                         pvmtracer.outtid = 0;
 2476                         pvmtracer.outctx = 0;
   ...
 2488                 } else {
 2489                         if (pvmdebmask & PDMTRACE) {
 2490                                 pvmlogprintf("tm_tracer() t%x tries to unregister?\n",
 2491                                                 tp->t_tid);
 2492                         }
 2493                         pkint(mp2, PvmNoTask);
 2494                 }
 2495         }
 2496  
 2497         /* Update slave pvmds */ 
 2498         if ( slconf ) {
 2499                 for (hh = hosts->ht_last; hh > 0; hh--) {
 2500                         if (hp = hosts->ht_hosts[hh]) {
true2501                                 mpd = mesg_new(0);
mpd <= 40952502                                 mpd->m_tag = DM_SLCONF;     /* Null Pointer Dereference */
 2503                                 mpd->m_dst = hp->hd_hostpart | TIDPVMD;
 2504                                 pkint(mpd, DM_SLCONF_TRACE);
 2505                                 sprintf(buf, "%x %d %d %x %d %d %d %d %s",
 2506                                         pvmtracer.trctid, pvmtracer.trcctx,
 2507                                                 pvmtracer.trctag,
 2508                                         pvmtracer.outtid, pvmtracer.outctx,
 2509                                                 pvmtracer.outtag,
 2510                                         pvmtracer.trcbuf, pvmtracer.trcopt,
 2511                                         pvmtracer.tmask);
 2512                                 pkstr(mpd, buf);
 2513                                 sendmessage(mpd);
Preconditions
&$unknown_1141103 != 0
hosts->ht_hosts[2] != 0
hosts->ht_last >= 3
numfrags = 0
numpmsgs != 0
pvmtracer.trctid = 0
Postconditions
freepmsgs.m_link->m_link->m_rlink' = freepmsgs.m_link->m_rlink
freepmsgs.m_link->m_rlink->m_link' = freepmsgs.m_link->m_link
freepmsgs.m_link' = &freepmsgs.m_link
freepmsgs.m_rlink' = &freepmsgs.m_link
hh' = 2
hp' = hosts->ht_hosts[2]
mp' = $param_2
mp2' = freepmsgs.m_link
mpd' = 0
numpmsgs' = 0
pvmtracer.trctid' = ((char*)$param_1)[32]
pvmtracer.outtid' = ((char*)$param_1)[32]
regme' = &$unknown_1141103
slconf' = 1
tmask[0]' = pvmtracer.tmask[0]
tp' = $param_1




Change Warning 2735.2788 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: