Text  |   XML   |   Visible Warnings:

Pvm : Pvm analysis 1 : Null Pointer Dereference  at ddpro.c:1471

Categories: LANG.MEM.NPD CWE:476
Warning ID: 2531.2562
Procedure: exectasks
Trace: View
Modified: Wed Sep 2 12:40:38 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/ddpro.c
   Enter exectasks
 1401 exectasks(mp, rmp, schtid) 
 1402         struct pmsg *mp;                /* the request message */ 
 1403         struct pmsg *rmp;               /* reply message blank */ 
 1404         int schtid;                             /* scheduler for new tasks */ 
 1405 {
 1406         struct pmsg *mp2;                       /* reply message hdl */ 
 1407         int i;
 1408         struct timeval now;
 1409         struct waitc_spawn *wxp;        /* new task parameters */ 
 1410         int munge_tenv = 0;
 1411         char tmp[255];
 1412         char *wd = 0;
 1413         char *savewd = 0;
 1414  
 1415         wxp = TALLOC(1, struct waitc_spawn, "waix");
 1416         BZERO((char*)wxp, sizeof(struct waitc_spawn));   /* Null Pointer Dereference (ID: 2534.2565) */
 1417  
 1418         /* unpack message */ 
 1419  
 1420         if (upkuint(mp, &wxp->w_ptid) 
 1421         || upkstralloc(mp, &wxp->w_file) 
 1422         || upkint(mp, &wxp->w_flags) 
 1423         || upkint(mp, &wxp->w_veclen) 
 1424         || upkint(mp, &wxp->w_argc))
 1425                 goto bad;
 1426  
 1427         if (wxp->w_veclen < 1)
 1428                 goto bad;
 1429         wxp->w_vec = TALLOC(wxp->w_veclen, int, "tids");
 1430  
 1431         wxp->w_argc += 2;
 1432         wxp->w_argv = TALLOC(wxp->w_argc + 1, char*, "argv");
 1433         BZERO((char*)wxp->w_argv, (wxp->w_argc + 1) * sizeof(char*));   /* Null Pointer Dereference (ID: 2533.2564) */
 1434         wxp->w_argv++;
 1435         wxp->w_argv[0] = wxp->w_file;   /* Null Pointer Dereference (ID: 2532.2563) */
 1436         wxp->w_file = 0;
 1437         wxp->w_argv[--wxp->w_argc] = 0;
 1438         for (i = 1; i < wxp->w_argc; i++)
 1439                 if (upkstralloc(mp, &wxp->w_argv[i]))
 1440                         goto bad;
 1441  
 1442         if (upkuint(mp, &wxp->w_outtid) 
 1443         || upkuint(mp, &wxp->w_outctx) 
 1444         || upkuint(mp, &wxp->w_outtag) 
 1445         || upkuint(mp, &wxp->w_trctid) 
 1446         || upkuint(mp, &wxp->w_trcctx) 
 1447         || upkuint(mp, &wxp->w_trctag) 
 1448         || upkuint(mp, &wxp->w_nenv))
 1449                 goto bad;
 1450  
 1451         wxp->w_hosttotal = wxp->w_veclen; /* this is the task count! */ 
 1452  
 1453         if (pvmtracer.trctid) {
 1454                 if (!(wxp->w_trctid) && pvmtracer.trctag) {
 1455                         wxp->w_trctid = pvmtracer.trctid;
 1456                         wxp->w_trcctx = pvmtracer.trcctx;
 1457                         wxp->w_trctag = pvmtracer.trctag;
 1458                         munge_tenv++;
 1459                 }
 1460         }
 1461  
 1462         if (pvmtracer.outtid) {
 1463                 if (!(wxp->w_outtid) && pvmtracer.outtag) {
 1464                         wxp->w_outtid = pvmtracer.outtid;
 1465                         wxp->w_outctx = pvmtracer.outctx;
 1466                         wxp->w_outtag = pvmtracer.outtag;
 1467                 }
 1468         }
 1469  
true1470         wxp->w_env = TALLOC((wxp->w_nenv + 1), char*, "env");
wxp->w_env <= 40951471         BZERO(wxp->w_env, (wxp->w_nenv + 1) * sizeof(char*));     /* Null Pointer Dereference */
Preconditions
&$unknown_437556 = 8 * ((char*)&$heap_29982)[72] + 8
&$unknown_437556 >= 1
((char*)&$heap_29982)[40] >= 1
((char*)&$heap_29982)[72] > -1
pvmtracer.trctid != 0
pvmtracer.outtag != 0
pvmtracer.trctag != 0
pvmtracer.outtid != 0
Postconditions
$heap_29982' = 0
bytes_after(&$heap_29982)' = 112
$heap_29982' is allocated by malloc
bytes_before(&$heap_29982)' = 0
strlen(&$heap_29982)' = 0
((char*)&$heap_29982)[16]' = &$heap_29983 + 8
((char*)&$heap_29982)[32]' = 0
((char*)&$heap_29982)[48]' = pvmtracer.outtid
((char*)&$heap_29982)[52]' = pvmtracer.outctx
((char*)&$heap_29982)[56]' = pvmtracer.outtag
((char*)&$heap_29982)[60]' = pvmtracer.trctid
((char*)&$heap_29982)[64]' = pvmtracer.trcctx
((char*)&$heap_29982)[68]' = pvmtracer.trctag
((char*)&$heap_29982)[80]' = 0
((char*)&$heap_29982)[100]' = ((char*)&$heap_29982)[40]
$heap_29983' = 0
$heap_29983' is allocated by malloc
bytes_before(&$heap_29983)' = 0
strlen(&$heap_29983)' = 0
((char*)&$heap_29983)[8]' = 0
mp' = $param_1
munge_tenv' = 1
rmp' = $param_2
savewd' = 0
schtid' = $param_3
wd' = 0
wxp' = &$heap_29982




Change Warning 2531.2562 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: