Text  |   XML   |   Visible Warnings:

pvm3.4.6 : pvm3.4.6 analysis 2 : Null Pointer Dereference  at pvmd.c:3715

Categories: LANG.MEM.NPD CWE:476
Warning ID: 315.28992
Procedure: sendmessage
Trace: view
Modified: Thu Nov 26 11:29:24 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/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  
true2436         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]) {
 2501                                 mpd = mesg_new(0);
 2502                                 mpd->m_tag = DM_SLCONF;   /* Null Pointer Dereference (ID: 316.28993) */
 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);
 2514                         }
 2515                 }
 2516         }
 2517  
 2518         /* Send response to requesting task */ 
mp2 <= 40952519         sendmessage(mp2);
Preconditions
&$unknown_1083190 != 0
hosts->ht_last >= 2
numpmsgs = 0
pvmtracer.trctid = 0
Postconditions
((char*)$unknown_1083199)[4]' = ((char*)&$unknown_1083199)[4]
((char*)$unknown_1083199)[4]' = $unknown_1083199
$unknown_1083199' = &freepmsgs.m_link
((char*)&$unknown_1083199)[4]' = &freepmsgs.m_link
ff' = 1
freepmsgs.m_link' = &$unknown_1083199
freepmsgs.m_rlink' = &$unknown_1083199
hh' = 0
hp' = 0
hp' = hosts->ht_hosts[1]
mp' = 0
mp2' = 0
mpd' = &$unknown_1083199
numpmsgs' = 1
pvmtracer.trctid' = tp->t_tid
strlen(&pvmtracer.trctid)' >= -58
pvmtracer.outctx' = octx'
pvmtracer.outtag' = otag'
pvmtracer.tmask[0]' = tmask[0]
pvmtracer.outtid' = tp->t_tid
regme' = &$unknown_1083190
slconf' = 1
tbuf' = pvmtracer.trcbuf'
tctx' = pvmtracer.trcctx'
topt' = pvmtracer.trcopt'
ttag' = pvmtracer.trctag'




Change Warning 315.28992 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: