Text  |   XML   |   Visible Warnings:

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

Categories: LANG.MEM.NPD CWE:476
Warning ID: 2447.2475
Procedure: assign_tasks
Trace: View
Modified: Wed Sep 2 12:39:35 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 assign_tasks
 1263 assign_tasks(wp) 
 1264         struct waitc *wp;               /* (any) waitc in peer group for this op */ 
 1265 {
 1266         static int lasthh = -1;                 /* for assigning hosts */ 
 1267  
 1268         struct waitc_spawn *wxp = (struct waitc_spawn*)wp->wa_spec;
 1269         struct htab *htp;                               /* set of hosts to use */ 
 1270         int *vec;                                               /* result/status vector */ 
 1271         int veclen;                                             /* length of vector */ 
 1272         int count = 0;                                  /* num of tasks to be assigned */ 
 1273         int nh;                                                 /* num of hosts to assign tasks */ 
 1274         int a = 0;                                              /* accum for finding hosts */ 
 1275         int na = 0;                                             /* num tasks assigned to a host */ 
 1276         struct waitc *wp2;
 1277         struct hostd *hp;
 1278         struct pmsg *mp;
 1279         int t;
 1280         int i;
 1281         int tid;
 1282         struct timeval now;
 1283  
 1284         if (!wxp)
 1285                 return 0;
 1286  
 1287         htp = wxp->w_ht;
 1288         vec = wxp->w_vec;
 1289         veclen = wxp->w_veclen;
 1290  
 1291         /*
 1292         * if no hosts left, fill unassigned entries with PvmNoHost 
 1293         */ 
 1294  
 1295         if (!htp->ht_cnt)
 1296                 for (t = veclen; t-- > 0; )
 1297                         if (!vec[t])
 1298                                 vec[t] = PvmNoHost;
 1299  
 1300         /*
 1301         * count tasks to be assigned, if none left reply to task 
 1302         */ 
 1303  
 1304         for (t = veclen; t-- > 0; )
 1305                 if (!vec[t])
 1306                         count++;
 1307  
 1308         if (!count) {
 1309                 pkint(wp->wa_mesg, wxp->w_veclen);
 1310                 for (t = 0; t < wxp->w_veclen; t++) {
 1311                         tid = wxp->w_vec[t];
 1312                         pkint(wp->wa_mesg, tid);
 1313                         if (TIDISTASK(tid) && wxp->w_trctid > 0) {
 1314                                 tev_send_spntask( 
 1315                                         wxp->w_trctid, wxp->w_trcctx, wxp->w_trctag,
 1316                                         tid, wxp->w_ptid );
 1317                         }
 1318                         if (TIDISTASK(tid) && wxp->w_outtid > 0) {
true1319                                 mp = mesg_new(0);
mp <= 40951320                                 mp->m_dst = wxp->w_outtid;     /* Null Pointer Dereference */
Preconditions
((char*)&((char*)*$param_1)[72])[40] >= 1
((char*)&((char*)*$param_1)[72])[48] >= 1
((char*)&((char*)((char*)*$param_1)[72])[24])[8] = 0
numpmsgs = 0
Postconditions
a' = 0
count' = 0
freepmsgs.m_link' = &freepmsgs.m_link
freepmsgs.m_rlink' = &freepmsgs.m_link
htp' = ((char*)&((char*)*$param_1)[72])[24]
mp' = 0
na' = 0
t' = 0
tid' = ((char*)((char*)*$param_1)[72])[32]
vec' = ((char*)&((char*)*$param_1)[72])[32]
veclen' = ((char*)&((char*)*$param_1)[72])[40]
wp' = $param_1
wxp' = ((char*)$param_1)[72]




Change Warning 2447.2475 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: